o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

Need help with GUI's and JLists.... -

I am working on an assignment for my advanced Java class. We are doing JLists for GUI's. I am not that good with GUIs, and I am having problems with valueChanged() method. I havent worked much with JLists before, so i am very new with them.

I am getting the error, inconvertible types in my ProdTest.Java file. I added a zip file containing all of my code so that anyone may look at it and help me out with this. I dont know what I am doing wrong.

Code:
	public void valueChanged(ListSelectionEvent e){
		Product product = (Product)listOfProds.getSelectedIndex();
		this.getContentPane().add(new ProductView(product), BorderLayout.EAST);
		pack();
	}

Here is what my assignment is supposed to be able to do
Quote:
Create a GUI for your Product application. Use a JList to show the list of products. When the user clicks on the item in the JList, show the complete information about that Product.

In addition, add the ability for the user to find a product by entering a Product ID#. Show the complete information on the product when found. Notify the user if the Product has not been found.

Requirement
JList class
Extends JList, uses ProductList as the model
Show the info from the selected product
ProductList class
Find a product – throw custom exception if not found
GUI
Allow user to find a Product using an index #.
Handle exceptions in the GUI – catch the find exception, as well as Java exceptions thrown by the get method in the ProductList class.
Show results of the find method call

 


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/genitalh/okquestions.com/relquery.php on line 79