Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void doWindow() {
- JPanel panel1 = new JPanel(); //janela principal
- JPanel panel2 = new JPanel(); //janela configurações
- panel1.setLayout(new FlowLayout());
- //janela principal
- JFrame mainFrame = new JFrame("Scheduler");
- mainFrame.setSize(800, 550);
- mainFrame.setLocationRelativeTo(null);
- mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
- mainFrame.add(panel1);
- //Botoes
- //Botao1
- JButton button1 = new JButton("Nova configuração");
- panel1.setLayout(null);
- button1.setBounds(300,100,200,60);
- panel1.add(button1);
- mainFrame.setVisible(true);
- button1.addActionListener(new ActionListener() {
- //janela de configuração
- public void actionPerformed(ActionEvent e) {
- JFrame configFrame = new JFrame("Configurações");
- configFrame.setSize(800, 550);
- configFrame.setLocationRelativeTo(null);
- configFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
- configFrame.add(panel2);
- mainFrame.setVisible(false);
- configFrame.setVisible(true);
- panel2.setLayout(null);
- //Campo1
- JLabel label1 = new JLabel("Nome da application pool");
- label1.setBounds(10, 50, 270, 25);
- label1.setHorizontalAlignment(JLabel.RIGHT);
- panel2.add(label1);
- //Campo1.1
- JTextField field1 = new JTextField();
- field1.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
- field1.setBorder(BorderFactory.createLoweredSoftBevelBorder());
- field1.setEditable(false);
- field1.setBounds(350,50,350,25);
- field1.setEditable(true);
- panel2.add(field1);
- //Campo2
- JLabel label2 = new JLabel("Envio de aviso automático");
- label2.setBounds(10, 100, 270, 25);
- label2.setHorizontalAlignment(JLabel.RIGHT);
- panel2.add(label2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement