JFrame frame = new JFrame("Recipes");
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 500);
frame.setLocation(430, 100);
JPanel panel = new JPanel();
frame.add(panel);
JLabel lbl = new JLabel("Select time taken");
lbl.setVisible(true);
panel.add(lbl);
String[] choices = { "10 MINS","15 MINS", "20 MINS","25 MINS","30 MINS"};
final JComboBox<String> cb = new JComboBox<String>(choices);
cb.setVisible(true);
panel.add(cb);
JButton btn = new JButton("OK");
panel.add(btn);`
我不知道在这之后要添加什么,我尝试添加另一个标签和组合框,但没有成功
1条答案
按热度按时间acruukt91#
确保
frame.setVisible(true);
在最后一行