Computer Science Homework Solutions

JAVA programming for a GUI: add a button to the GUI that allows the user to move to the first item, the previous item, the next item, and the last item in the list.

As many of the other individuals submitting problems, I too have an issue with my Java programming. My current dilemma is: Modify the Inventory Program by adding a button to the GUI that allows the user to move to the first item, the previous item, the next item, and the last item in the inventory. If the first item is displayed ...continues

Java Programming

I have a question about something that has puzzled me. I did this on my program because it was how I saw it done. I was wondering if someone could explain why it is done this way and if I would do this for all ActionEvents. I used the following code. What does the ".getSource()" do? Is that what registers when someone ...continues

Java Programming Question

Can you explain the components of this code for me? javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { new testEvents(); Basically, when I read this code, I just want to know how it works, what it does, when would I use this, would I use it every time, etc. Thanks!

Java - ListMerge

Write a program that merges two ordered-list objects of integers into a single ordered-list object of integers. Method merge of class ListMerge should receive references to each of the list objects to be merged and return a reference to the merged list object. Tips: http://www.engineering.uiowa.edu/~swd/LectureNotes/JavaHTP6e ...continues

Multi threading - Java

State whether each of the following is true or false. If false, explain why. a) Method sleep does not consume processor time while a thread sleeps. b) Using a Lock guarantees that deadlock cannot occur. c) Once a Lock has been obtained by a thread, the Lock object will not allow another thread to obtain the lock until the f ...continues

Java Programming/Mortgage

Please help me create a GUI with 3 JTextField (one for loan amount, one for term, and one for interest rate), one JTextArea (where the monthly payment schedule will be displayed; appended for each month, for all moths; attach a JScrollPane to the JTextArea), one JComboBox (with 3 selections: 7 year at 5.35%, 15 year at 5.5 %, 3 ...continues

Binary Tree Delete Java

(Binary Tree Delete) In this exercise, we discuss deleting items from binary search trees. The deletion algorithm is not as straightforward as the insertion algorithm. There are three cases that are encountered when deleting an item–the item is contained in a leaf node (i.e., it has no children), the item is contained in a node ...continues

GUI Components - Java - Guess the Number

Write an application that plays "guess the number" as follows: Your application chooses the number to be guessed by selecting an integer at random in the range 1-1000. The application then displays the following in a label: I have a number between 1 and 1000. Can you guess my number? Please enter your first guess. A JText ...continues

Java Applets - Floating-Point Numbers

Write an applet that asks the user to enter two floating-point numbers, obtains the numbers from the user and displays the two numbers first and then the larger number followed by the words "is larger" as a string on the applet. If the numbers are equal, the applet should print the message "These numbers are equal." Use the tech ...continues

Java Applets - Class Graphics contains method drawOval

Class Graphics contains method drawOval, which takes as arguments the same four arguments as method drawRect. The arguments for method drawOval specify the "bounding box for the oval - the sides of the bounding box are the boundaries of the oval. Write a Java applet that draws an oval and a rectangle with the same four arguments ...continues

Browse