Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java JLists

Name: Anonymous 2011-03-12 0:50

I'm relatively new to creating GUI interfaces. Up until now, I've used a package called BreezySwing which basically simplifies the creation process to instantiate most GUI objects.

For example: JButton b = addButton("OK",1,1,1,1); makes a JButton with the label "OK" at the top left of the gui.

But now I need to make a JList, and my package doesn't have the necessary methods to make one and successfully use a mouse listener. Something about the method creating a JDefaultList or something, where the mouse listener wants a JList or vice versa.

So how do I put a JList on my GUI and implement a mouse listener?

Thanks guys.

Name: Anonymous 2011-03-12 12:18

String[] x = {"derp1","derp2","derp3"};
        listModel = new DefaultListModel();
        list = new JList(listModel);
        this.add(list);
        list.setListData(x);


This adds a JList, but it's fucking tiny. It's only 5 characters wide and 3 lines tall. How do I make it fill up the space I need it to?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List