Example usage for javax.swing JButton setBounds

List of usage examples for javax.swing JButton setBounds

Introduction

In this page you can find the example usage for javax.swing JButton setBounds.

Prototype

public void setBounds(int x, int y, int width, int height) 

Source Link

Document

Moves and resizes this component.

Usage

From source file:Main.java

public Main() {
    JPanel panel = new JPanel();
    panel.setLayout(null);/*from w  w  w  .j  ava2  s  . c  om*/

    model = new DefaultListModel();
    list = new JList(model);
    list.setBounds(150, 30, 220, 150);

    JButton okButton = new JButton("Ok");
    okButton.setBounds(30, 35, 80, 25);

    okButton.addActionListener(this);

    panel.add(okButton);
    panel.add(list);
    add(panel);

    setSize(420, 250);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(EXIT_ON_CLOSE);

}

From source file:Main.java

public Main() {
    super("Test");
    setSize(200, 200);// w  w  w .java2  s .c o  m

    JPanel panel = new JPanel();
    setContentPane(panel);

    JButton button1 = new JButton("Button 1");
    JButton button2 = new JButton("Button 2");
    JButton button3 = new JButton("Button 3");

    button1.setBounds(10, 10, 100, 40);
    button2.setBounds(5, 5, 100, 30);
    button3.setBounds(15, 15, 150, 40);

    panel.setLayout(null);

    panel.add(button1);
    panel.add(button2);
    panel.add(button3);

    panel.setComponentZOrder(button1, 1);
    panel.setComponentZOrder(button2, 0);
    panel.setComponentZOrder(button3, 2);

    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);
}

From source file:postenergy.PostEnergy.java

private void initUI() {

    /* Definitions */
    JPanel panel = new JPanel();
    getContentPane().add(panel);//w w w  . j a v  a  2 s . c o  m

    panel.setLayout(null);

    /* Basic elements */

    JButton getBatteryInfo = new JButton("Get Battery Info");
    getBatteryInfo.setBounds(0, 60, 180, 30);
    getBatteryInfo.setToolTipText("Get Battery Info");
    getBatteryInfo.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            System.out.println("getBatteryInfo button pressed!");

            ProcessBuilder pbs = new ProcessBuilder("/Users/thomas/Development/script.sh");

            try {
                Process p = pbs.start();
                BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
                StringBuilder builder = new StringBuilder();
                String line = null;
                try {
                    while ((line = br.readLine()) != null) {
                        builder.append(line);
                        builder.append(System.getProperty("line.separator"));
                    }
                } catch (IOException ex) {
                    Logger.getLogger(PostEnergy.class.getName()).log(Level.SEVERE, null, ex);
                }
                String result = builder.toString();
                System.out.println("Result: " + result);

                // Send as POST request
                String[] paramNames = new String[] { "t", "h" };
                String[] paramVals = new String[] { result, result + 100 };

                PostHttpClient("mindass", paramNames, paramVals);
            } catch (IOException ex) {
                System.out.println("Error with the processbuilder!");
                Logger.getLogger(PostEnergy.class.getName()).log(Level.SEVERE, null, ex);
            }

        }
    });

    panel.add(getBatteryInfo);

    JButton sendPost = new JButton("Send Post");
    sendPost.setBounds(0, 30, 180, 30);
    sendPost.setToolTipText("Send Post");

    sendPost.addActionListener(new ActionListener() {
        @Override

        public void actionPerformed(ActionEvent event) {
            System.out.println("sendPost button pressed!");

            PostHttpClient("mindass", new String[] { "t", "h" }, new String[] { "23", "44" });

        }

    });

    panel.add(sendPost);

    JButton quitButton = new JButton("Quit");
    quitButton.setBounds(0, 0, 80, 30);
    quitButton.setToolTipText("Quit iPower");

    quitButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent event) {
            System.out.println("Quit button pressed!");
            System.exit(0);
        }
    });

    panel.add(quitButton);

    /* Set init */
    setTitle("iPower");
    setSize(300, 200);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
}

From source file:techtonic.WellBoreListenerOnView.java

public void loadLogs() {
    List<WitsmlLog> logs = xmlreader.getLogs(wellbore);
    //   System.out.println("Number of Logs: "+logs.size());
    logPanel.removeAll();//from  w w  w . j  av  a  2s .c  o m
    for (int i = 0; i < logs.size(); i++) {
        WitsmlLog log = logs.get(i);
        JButton btn = new JButton("<html><b>Name:  " + log.getName() + "</b><br/></html>");
        //  btn.setBounds(5, 5, logPanel.getWidth() - 10, 80);
        btn.setBounds(5, ((100 * i + 5)), logPanel.getWidth() - 50, 100);
        btn.addActionListener(new PlotLogGraphListener(log));
        logPanel.add(btn);
    }
    logPanel.validate();
    logPanel.repaint();
}

From source file:gov.nih.nci.nbia.StandaloneDM.java

private JPanel constructLoginPanel() {
    JPanel contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    contentPane.setLayout(null);//from  w ww.  jav a  2  s.com

    JLabel lblNewLabel_2 = new JLabel();
    lblNewLabel_2.setBounds(20, 11, 100, 100);
    contentPane.add(lblNewLabel_2);
    ImageIcon iconLogo = new ImageIcon("Images/global.logo");
    lblNewLabel_2.setIcon(iconLogo);
    statusLbl = new JLabel(
            "<html>Some or all of the images you are about to download are from<br>private collection(s). Please log in first.</html>");
    contentPane.add(statusLbl);
    statusLbl.setBounds(110, 11, 500, 42);
    JLabel lblNewLabel = new JLabel("User Name");
    contentPane.add(lblNewLabel);
    lblNewLabel.setBounds(110, 79, 77, 31);

    userNameFld = new JTextField();
    contentPane.add(userNameFld);
    userNameFld.setBounds(187, 75, 333, 36);
    userNameFld.setColumns(10);

    JButton submitBtn = new JButton(SubmitBtnLbl);
    submitBtn.addActionListener(new BtnListener());
    contentPane.add(submitBtn);
    submitBtn.setBounds(249, 200, 139, 36);

    passwdFld = new JPasswordField();
    contentPane.add(passwdFld);
    passwdFld.setBounds(187, 129, 333, 36);

    userNameFld.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            passwdFld.requestFocus();
        }
    });

    passwdFld.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            userId = userNameFld.getText();
            password = passwdFld.getText();
            if ((userId.length() < 1) || (password.length() < 1)) {
                statusLbl.setText("Please enter a valid user name and password.");
                statusLbl.setForeground(Color.red);
            } else
                submitUserCredential(userId, password);
        }
    });

    JLabel lblNewLabel_1 = new JLabel("Password");
    contentPane.add(lblNewLabel_1);
    lblNewLabel_1.setBounds(110, 129, 77, 36);

    return contentPane;
}

From source file:NwFontChooserS.java

private void addButtons() {
    JButton ok = new JButton("OK");
    ok.setMargin(new Insets(0, 0, 0, 0));
    JButton ca = new JButton("Cancel");
    ca.setMargin(new Insets(0, 0, 0, 0));
    ok.setBounds(260, 350, 70, 20);
    ok.setFont(new Font(" ", 1, 11));
    ca.setBounds(340, 350, 70, 20);//from www.j  a va  2 s . c om
    ca.setFont(new Font(" ", 1, 12));
    getContentPane().add(ok);
    getContentPane().add(ca);
    ok.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            setVisible(false);
            ob = true;
        }
    });
    ca.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            setVisible(false);
            ob = false;
        }
    });
}

From source file:org.jfree.chart.demo.Display.java

/**
 * Initialize the contents of the frame.
 */// w ww. ja  v a  2  s  .  c o  m
private void initialize() {
    frame = new JFrame();
    frame.setBounds(100, 100, frameW, frameH);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(null);

    tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.setBounds(12, 5, 1200, 700);
    frame.getContentPane().add(tabbedPane);

    panel = new JPanel();
    tabbedPane.addTab("Parameters", null, panel, null);
    panel.setLayout(null);

    txtMass = new JTextField();
    txtMass.setText("0.0");
    txtMass.setBounds(307, 63, 114, 19);
    panel.add(txtMass);
    txtMass.setColumns(10);

    txtLength = new JTextField();
    txtLength.setText("0.0");
    txtLength.setBounds(307, 94, 114, 19);
    panel.add(txtLength);
    txtLength.setColumns(10);

    txtZenith = new JTextField();
    txtZenith.setText("0.0");
    txtZenith.setBounds(307, 125, 114, 19);
    panel.add(txtZenith);
    txtZenith.setColumns(10);

    JLabel lblInitialConditions = new JLabel("Initial Conditions");
    lblInitialConditions.setBounds(307, 36, 120, 15);
    panel.add(lblInitialConditions);

    JButton btnSetParam = new JButton("Set Param");
    btnSetParam.setBounds(445, 31, 107, 25);
    panel.add(btnSetParam);

    JLabel lblMass = new JLabel("Mass");
    lblMass.setBounds(438, 65, 70, 15);
    panel.add(lblMass);

    JLabel lblLength = new JLabel("Length");
    lblLength.setBounds(439, 96, 70, 15);
    panel.add(lblLength);

    JLabel lblZenithAngle = new JLabel("Zenith Angle");
    lblZenithAngle.setBounds(439, 122, 114, 25);
    panel.add(lblZenithAngle);

    RAzimuth = new JTextField();
    RAzimuth.setText("0.0");
    RAzimuth.setBounds(307, 156, 114, 19);
    panel.add(RAzimuth);
    RAzimuth.setColumns(10);

    JLabel lblReleaseAzimuth = new JLabel("Release Azimuth");
    lblReleaseAzimuth.setBounds(438, 158, 131, 15);
    panel.add(lblReleaseAzimuth);

    TAzimuth = new JTextField();
    TAzimuth.setText("0.0");
    TAzimuth.setBounds(307, 187, 114, 19);
    panel.add(TAzimuth);
    TAzimuth.setColumns(10);

    JLabel lblTabletAzimuth = new JLabel("Tablet Azimuth");
    lblTabletAzimuth.setBounds(438, 189, 124, 15);
    panel.add(lblTabletAzimuth);

    TimeElapsed = new JTextField();
    TimeElapsed.setBounds(719, 63, 114, 19);
    panel.add(TimeElapsed);
    TimeElapsed.setColumns(10);

    JLabel lblTimeElapsed = new JLabel("Time Elapsed");
    lblTimeElapsed.setBounds(863, 65, 147, 15);
    panel.add(lblTimeElapsed);

    AzDisp = new JTextField();
    AzDisp.setBounds(719, 125, 114, 19);
    panel.add(AzDisp);
    AzDisp.setColumns(10);

    JLabel lblAzimuthalDisplacement = new JLabel("Azimuthal Displacement");
    lblAzimuthalDisplacement.setBounds(863, 127, 182, 15);
    panel.add(lblAzimuthalDisplacement);

    Lat = new JTextField();
    Lat.setBounds(719, 187, 114, 19);
    panel.add(Lat);
    Lat.setColumns(10);

    JLabel lblLatitude = new JLabel("Latitude");
    lblLatitude.setBounds(866, 189, 70, 15);
    panel.add(lblLatitude);

    JLabel lblCalculations = new JLabel("Calculations");
    lblCalculations.setBounds(719, 36, 114, 15);
    panel.add(lblCalculations);

    EffXInput = new JTextField();
    EffXInput.setText("15240");
    EffXInput.setBounds(307, 303, 114, 19);
    panel.add(EffXInput);
    EffXInput.setColumns(10);

    EffYInput = new JTextField();
    EffYInput.setText("9298");
    EffYInput.setBounds(307, 340, 114, 19);
    panel.add(EffYInput);
    EffYInput.setColumns(10);

    JLabel lblTabletSettings = new JLabel("Tablet Settings");
    lblTabletSettings.setBounds(326, 270, 114, 15);
    panel.add(lblTabletSettings);

    JLabel lblNumberOfEffective = new JLabel("Number of Effective Lines in X Area");
    lblNumberOfEffective.setBounds(438, 305, 270, 15);
    panel.add(lblNumberOfEffective);

    JLabel lblNumberOfEffective_1 = new JLabel("Number of Effective Lines in Y Area");
    lblNumberOfEffective_1.setBounds(438, 342, 251, 15);
    panel.add(lblNumberOfEffective_1);

    JButton btnApplySettings = new JButton("Apply Settings");
    btnApplySettings.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            effectiveX = Integer.parseInt(EffXInput.getText());
            effectiveY = Integer.parseInt(EffYInput.getText());
        }
    });
    btnApplySettings.setBounds(452, 265, 153, 25);
    panel.add(btnApplySettings);

    JButton startbtn = new JButton("Begin Data Collection");
    startbtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            enabled = true;
        }
    });
    startbtn.setBounds(826, 300, 219, 25);
    panel.add(startbtn);

    JButton endbtn = new JButton("End Data Collection");
    endbtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            enabled = false;
        }
    });
    endbtn.setBounds(826, 352, 219, 25);
    panel.add(endbtn);

    btnSetParam.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            analysis.setZenith(Double.parseDouble(txtZenith.getText()));
            analysis.setLength(Double.parseDouble(txtLength.getText()));
            analysis.setMass(Double.parseDouble(txtMass.getText()));
            analysis.setRAzimuth(Double.parseDouble(RAzimuth.getText()));
            analysis.setTAzimuth(Double.parseDouble(TAzimuth.getText()));

        }
    });

    panel_1 = new ScatterCanvas(frameW, frameH, effectiveX, effectiveY);
    tabbedPane.addTab("Position", null, panel_1, null);

    //panel_2 = new ScatterCanvas();
    tabbedPane.addTab("Angular Displacement", null, panel_2, null);
}

From source file:techtonic.WellBoreListenerOnView.java

public void loadTrajectory() {
    List<WitsmlTrajectory> trajectorys = xmlreader.getTrajectorys(wellbore);
    // System.out.println("Number of Trajectory: "+trajectorys.size());
    trajectoryPanel.removeAll();//from w w w  .  j  a va  2 s . c  om
    // trajectoryPanel.setPreferredSize(new Dimension(trajectorys.size(), trajectoryPanel.getWidth()* 105));
    System.out.println("panel size" + trajectoryPanel.getHeight());
    for (int i = 0; i < trajectorys.size(); i++) {
        WitsmlTrajectory trajectory = trajectorys.get(i);
        JButton btn = new JButton("<html><b>Name:  " + trajectory.getName() + "</b><br/> Number of Stations:  "
                + trajectory.getStations().size() + "</br></html>");
        // btn.setBounds(5, 5, trajectoryPanel.getWidth() - 10, 80);
        btn.setBounds(5, ((100 * i + 5)), trajectoryPanel.getWidth() - 20, 100);

        btn.addActionListener(new PlotGraphListener(trajectory));

        trajectoryPanel.add(btn);

    }
    superImposGraph(trajectorys);
    trajectoryPanel.validate();
    Techtonic.validateJSP();

    trajectoryPanel.repaint();
}

From source file:com.milkdairy.collectionsmodule.CollectionsUpdateFormJPanel.java

public JButton addComponent(JButton comp, int xx, int yy, int width, int height) {
    comp = new JButton();
    comp.setBounds(xx, yy, width, height);
    // comp.setOpaque(true);
    this.add(comp);
    return comp;/*from   w w w. jav a  2s .co m*/
}

From source file:hspc.submissionsprogram.AppDisplay.java

AppDisplay() {
    this.setTitle("Dominion High School Programming Contest");
    this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    this.setResizable(false);

    WindowListener exitListener = new WindowAdapter() {
        @Override//w w w  . j  av  a2 s  .c om
        public void windowClosing(WindowEvent e) {
            System.exit(0);
        }
    };
    this.addWindowListener(exitListener);

    JTabbedPane pane = new JTabbedPane();
    this.add(pane);

    JPanel submitPanel = new JPanel(null);
    submitPanel.setPreferredSize(new Dimension(500, 500));

    UIManager.put("FileChooser.readOnly", true);
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setBounds(0, 0, 500, 350);
    fileChooser.setVisible(true);
    FileNameExtensionFilter javaFilter = new FileNameExtensionFilter("Java files (*.java)", "java");
    fileChooser.setFileFilter(javaFilter);
    fileChooser.setAcceptAllFileFilterUsed(false);
    fileChooser.setControlButtonsAreShown(false);
    submitPanel.add(fileChooser);

    JSeparator separator1 = new JSeparator();
    separator1.setBounds(12, 350, 476, 2);
    separator1.setForeground(new Color(122, 138, 152));
    submitPanel.add(separator1);

    JLabel problemChooserLabel = new JLabel("Problem:");
    problemChooserLabel.setBounds(12, 360, 74, 25);
    submitPanel.add(problemChooserLabel);

    String[] listOfProblems = Main.Configuration.get("problem_names")
            .split(Main.Configuration.get("name_delimiter"));
    JComboBox problems = new JComboBox<>(listOfProblems);
    problems.setBounds(96, 360, 393, 25);
    submitPanel.add(problems);

    JButton submit = new JButton("Submit");
    submit.setBounds(170, 458, 160, 30);
    submit.addActionListener(e -> {
        try {
            File file = fileChooser.getSelectedFile();
            try {
                CloseableHttpClient httpClient = HttpClients.createDefault();
                HttpPost uploadFile = new HttpPost(Main.Configuration.get("submit_url"));

                MultipartEntityBuilder builder = MultipartEntityBuilder.create();
                builder.addTextBody("accountID", Main.accountID, ContentType.TEXT_PLAIN);
                builder.addTextBody("problem", String.valueOf(problems.getSelectedItem()),
                        ContentType.TEXT_PLAIN);
                builder.addBinaryBody("submission", file, ContentType.APPLICATION_OCTET_STREAM, file.getName());
                HttpEntity multipart = builder.build();

                uploadFile.setEntity(multipart);

                CloseableHttpResponse response = httpClient.execute(uploadFile);
                HttpEntity responseEntity = response.getEntity();
                String inputLine;
                BufferedReader br = new BufferedReader(new InputStreamReader(responseEntity.getContent()));
                try {
                    if ((inputLine = br.readLine()) != null) {
                        int rowIndex = Integer.parseInt(inputLine);
                        new ResultWatcher(rowIndex);
                    }
                    br.close();
                } catch (IOException ex) {
                    ex.printStackTrace();
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        } catch (NullPointerException ex) {
            JOptionPane.showMessageDialog(this, "No file selected.\nPlease select a java file.", "Error",
                    JOptionPane.WARNING_MESSAGE);
        }
    });
    submitPanel.add(submit);

    JPanel clarificationsPanel = new JPanel(null);
    clarificationsPanel.setPreferredSize(new Dimension(500, 500));

    cList = new JList<>();
    cList.setBounds(12, 12, 476, 200);
    cList.setBorder(new CompoundBorder(BorderFactory.createLineBorder(new Color(122, 138, 152)),
            BorderFactory.createEmptyBorder(8, 8, 8, 8)));
    cList.setBackground(new Color(254, 254, 255));
    clarificationsPanel.add(cList);

    JButton viewC = new JButton("View");
    viewC.setBounds(12, 224, 232, 25);
    viewC.addActionListener(e -> {
        if (cList.getSelectedIndex() != -1) {
            int id = Integer.parseInt(cList.getSelectedValue().split("\\.")[0]);
            clarificationDatas.stream().filter(data -> data.getId() == id).forEach(
                    data -> new ClarificationDisplay(data.getProblem(), data.getText(), data.getResponse()));
        }
    });
    clarificationsPanel.add(viewC);

    JButton refreshC = new JButton("Refresh");
    refreshC.setBounds(256, 224, 232, 25);
    refreshC.addActionListener(e -> updateCList(true));
    clarificationsPanel.add(refreshC);

    JSeparator separator2 = new JSeparator();
    separator2.setBounds(12, 261, 476, 2);
    separator2.setForeground(new Color(122, 138, 152));
    clarificationsPanel.add(separator2);

    JLabel problemChooserLabelC = new JLabel("Problem:");
    problemChooserLabelC.setBounds(12, 273, 74, 25);
    clarificationsPanel.add(problemChooserLabelC);

    JComboBox problemsC = new JComboBox<>(listOfProblems);
    problemsC.setBounds(96, 273, 393, 25);
    clarificationsPanel.add(problemsC);

    JTextArea textAreaC = new JTextArea();
    textAreaC.setLineWrap(true);
    textAreaC.setWrapStyleWord(true);
    textAreaC.setBorder(new CompoundBorder(BorderFactory.createLineBorder(new Color(122, 138, 152)),
            BorderFactory.createEmptyBorder(8, 8, 8, 8)));
    textAreaC.setBackground(new Color(254, 254, 255));

    JScrollPane areaScrollPane = new JScrollPane(textAreaC);
    areaScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    areaScrollPane.setBounds(12, 312, 477, 134);
    clarificationsPanel.add(areaScrollPane);

    JButton submitC = new JButton("Submit Clarification");
    submitC.setBounds(170, 458, 160, 30);
    submitC.addActionListener(e -> {
        if (textAreaC.getText().length() > 2048) {
            JOptionPane.showMessageDialog(this,
                    "Clarification body is too long.\nMaximum of 2048 characters allowed.", "Error",
                    JOptionPane.WARNING_MESSAGE);
        } else if (textAreaC.getText().length() < 20) {
            JOptionPane.showMessageDialog(this,
                    "Clarification body is too short.\nClarifications must be at least 20 characters, but no more than 2048.",
                    "Error", JOptionPane.WARNING_MESSAGE);
        } else {
            Connection conn = null;
            PreparedStatement stmt = null;
            try {
                Class.forName(JDBC_DRIVER);

                conn = DriverManager.getConnection(Main.Configuration.get("jdbc_mysql_address"),
                        Main.Configuration.get("mysql_user"), Main.Configuration.get("mysql_pass"));

                String sql = "INSERT INTO clarifications (team, problem, text) VALUES (?, ?, ?)";
                stmt = conn.prepareStatement(sql);

                stmt.setInt(1, Integer.parseInt(String.valueOf(Main.accountID)));
                stmt.setString(2, String.valueOf(problemsC.getSelectedItem()));
                stmt.setString(3, String.valueOf(textAreaC.getText()));

                textAreaC.setText("");

                stmt.executeUpdate();

                stmt.close();
                conn.close();

                updateCList(false);
            } catch (Exception ex) {
                ex.printStackTrace();
            } finally {
                try {
                    if (stmt != null) {
                        stmt.close();
                    }
                } catch (Exception ex2) {
                    ex2.printStackTrace();
                }
                try {
                    if (conn != null) {
                        conn.close();
                    }
                } catch (Exception ex2) {
                    ex2.printStackTrace();
                }
            }
        }
    });
    clarificationsPanel.add(submitC);

    pane.addTab("Submit", submitPanel);
    pane.addTab("Clarifications", clarificationsPanel);

    Timer timer = new Timer();
    TimerTask updateTask = new TimerTask() {
        @Override
        public void run() {
            updateCList(false);
        }
    };
    timer.schedule(updateTask, 10000, 10000);

    updateCList(false);

    this.pack();
    this.setLocationRelativeTo(null);
    this.setVisible(true);
}