import java.util.ArrayList; import java.util.List; import java.util.Vector; import javax.swing.*; public class CronJob extends JFrame { CronJob(String title) { super(title); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //********** minute ********************************** Vector minute = new Vector(); minute.add(0, "0"); minute.add(1, "1"); minute.add(2, "2"); minute.add(3, "3"); minute.add(4, "4"); minute.add(5, "5"); //********** Hour ********************************** Vector hour = new Vector(); hour.add(0, "0"); hour.add(1, "1"); hour.add(2, "2"); hour.add(3, "3"); hour.add(4, "4"); hour.add(5, "5"); JComboBox jcb = new JComboBox(minute); getContentPane().add(jcb); JComboBox jcb2 = new JComboBox(hour); getContentPane().add(jcb2); setSize(40, 60); setVisible(true); } //*********** minute**************** public static void main(String[] args) { new CronJob("Cron Job"); } }
JComboBox jcb = new JComboBox(minute); //set size and position jcb.setSize(100, 20); jcb.setLocation(10, 10); JComboBox jcb2 = new JComboBox(hour); jcb2.setSize(100, 20); jcb2.setLocation(120, 10); getContentPane().add(jcb); getContentPane().add(jcb2);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)