Homework 3 – What events do the following components generate

CMSC 405 CMSC 335

Having Trouble Meeting Your Deadline?

Get your assignment on Homework 3 – What events do the following components generate completed on time. avoid delay and – ORDER NOW

Homework 3

1. (5 pts) What events do the following components generate in either Swing or FX:

• JButton or Button • JTextField or TextField • JComboBox or ComboBox

2. (5 pts) What methods does JTable implement which are required by the interfaces implemented by the JTable class beyond those interfaces implemented by the various parent classes of JTable? 3. (5 pts) Address how the differences among these various layout managers, focusing on their behavior as their container is resized:

a. FlowPane in FX (or FlowLayout in Swing) b. GridPane in FX (or GridLayout in Swing) c. AncherPane d. TilePane e. Any other layout of your choice in FX or Swing.

4. (10 pts) (Ex 1.8.2) The dining philosophers problem was invented by E. W. Dijkstra, a concurrency pioneer, to clarify the notions of deadlock and starvation freedom. Imagine five philosophers who spend their lives just thinking and feasting. They sit around a circular table with five chairs. The table has a big plate of rice. However, there are only five chopsticks (in the original formulation forks) available, as shown in Fig. 1.5. Each philosopher thinks. When he gets hungry, he sits down and picks up the two chopsticks that are closest to him. If a philosopher can pick up both chopsticks, he can eat for a while. After a philosopher finishes eating, he puts down the chopsticks and again starts to think.

a. What is wrong with everybody doing the following – other than that the philosophers never get up from the table?

1. think for a while 2. get left chopstick 3. get right chopstick 4. eat for a while 5. return left chopstick 6. return right chopstick 7. return to 1

b. How can the above be fixed to avoid deadlocks?

c. Is your solution starvation free? Literally!

5. (10 pts) What methods must a class implementing the java.util.concurrent.locks.Lock interface implement? Describe some of the expected characteristics of each of the methods of this interface?

6. (5 pts) Explain what the JVM does when it encounters a synchronized directive. Hint: consider carefully what is synchronized.

7. (10 pts) What is the difference between Lock Interface and synchronized keyword?

Explanation & Answer

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Order Now and we will direct you to our Order Page at Litessays. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

Similar Posts