Demo entry 6423545

123

   

Submitted by 123 on May 26, 2017 at 03:00
Language: Java. Code size: 603 Bytes.

class MyFrame01 extends JFrame {

	JList<String> list;
	String[] data = { "국어", "영어", "수학", "과학", "국어", "영어", "수학", "과학" };
	JComboBox<String> combo;

	public MyFrame01() {
		setLayout(new BorderLayout());
		list = new JList<String>(data);
		JScrollPane pane = new JScrollPane(list);
		add(pane, BorderLayout.CENTER);

		combo = new JComboBox<String>(data);
		add(combo, BorderLayout.SOUTH);

		setSize(500, 500);
		setVisible(true);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
	}
}

public class Test01_JList {
	public static void main(String[] args) {
		new MyFrame01();
	}
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).