aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JAVA JButton Functionality Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JAVA JButton Functionality" Watch "JAVA JButton Functionality" New topic
Author

JAVA JButton Functionality

Nathe Chan
Ranch Hand

Joined: Mar 12, 2009
Posts: 33
Basic Problem: I have a problem understanding how to import the JList Vector Array from a mandatory, external class named MovieInfo.Java that cannot change.

I am really boggled right now.

To see my assignment visually, please read the SCRIBD file. :P
URL: http://www.scribd.com/doc/13082448/CSIS1275Assign3w2009

So, the teacher wants me to click on the button 'Click For Movies'. Once clicked on, it will then display the movie data in their respective JList boxes (the data should be in a class named MovieInfo.JAVA. By the way, the data for the JList boxes should be blank at first. I have created it, but I have no clue what to do now.

Here is my class for MOVIEINFO.JAVA that I have created.



Am I supposed to call this by using:

MovieInfo minfo = new MovieInfo() ?

My main class is this:


MOVIEBUY.JAVA



The fact is that I do not want to call the JList box arrays from the String[] arrays I have used in the main class, the MOVIEBUY.JAVA class. I want to comment them out and add my real arrays from here:



Can someone explain to me how this can be carried out?

If you can help me iout, that would be great.

- Nathe
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38896
    
  23
Sounds like a Swing-related question. Moving.

And avoid using NetBeans or other IDEs until you are used to writing GUI code; the blocks of code in the init() method are really difficult to read.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Basic Problem: I have a problem understanding how to import the JList Vector Array from a mandatory, external class named MovieInfo.Java that cannot change.

simple demo of your 'basic problem', but using an app, not applet
(stripped MovieInfo down to bare bones - getters/setters not required in demo)

Nathe Chan
Ranch Hand

Joined: Mar 12, 2009
Posts: 33
Sorry, I don't get the line that says:

Vector<MovieInfo> vec = new Vector<MovieInfo>(Arrays.asList(movieList.mList));

How exactly is it supposed to be written? Without the <MovieInfo>?
Nathe Chan
Ranch Hand

Joined: Mar 12, 2009
Posts: 33
I just figured it out. . It's without the <MovieInfo>. Thanks for helping me learn!
I haven't read JAVA retail books yet. I'm going to read them soon.
- Nathe
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Sorry, I don't get the line that says:
>Vector<MovieInfo> vec = new Vector<MovieInfo>(Arrays.asList(movieList.mList));

you have an array mList

go to the Arrays apidocs, read what asList() returns
go to the Vector apidocs, read the various constructors

should make sense now
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAVA JButton Functionality