• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAVA JButton Functionality

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> 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
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> 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
 
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic