import javax.swing.JFrame;
import javax.swing.JList;
public class ListTest {
public ListTest() {
JFrame frame = new JFrame();
frame.setTitle("JList Test");
frame.setSize(640,480);
frame.setLocationRelativeTo(null);
String[] items = {"One", "Two", "Three"};
JList list = new JList(items);
frame.add(list);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
public static void main(String[] args) {
new ListTest();
}
}
Sunday, October 31, 2021
JList Populated From String Array
Subscribe to:
Post Comments (Atom)
Ever feel like no one is listening?
Ever have that feeling that no one is listening to you? Yeah, that feeling. It can be a strong feeling to have, a hurtful feeling also. The...
-
Ever have that feeling that no one is listening to you? Yeah, that feeling. It can be a strong feeling to have, a hurtful feeling also. The...
-
Let's face it, this life isn't easy. Ther are things that we must do daily in order to survive. It can feel like you don't have...
-
Here's an easy method to return yesterday's date: import java.time.LocalDateTime; public class DoIt { public static void mai...
No comments:
Post a Comment