Example usage for javax.swing JLabel setBounds

List of usage examples for javax.swing JLabel setBounds

Introduction

In this page you can find the example usage for javax.swing JLabel 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:gov.nih.nci.nbia.StandaloneDM.java

private JPanel constructLoginPanel() {
    JPanel contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    contentPane.setLayout(null);/*www. j a  v a  2 s . c o  m*/

    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:JSplash.java

private void init() {
    JPanel pnlImage = new JPanel();
    ImageIcon image = new ImageIcon(getClass().getResource("img/logo.jpg"));
    JLabel lblBack = new JLabel(image);
    Border raisedbevel = BorderFactory.createRaisedBevelBorder();
    Border loweredbevel = BorderFactory.createLoweredBevelBorder();

    lblBack.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
    getLayeredPane().add(lblBack, new Integer(Integer.MIN_VALUE));

    pnlImage.setLayout(null);//from w  w  w  .j a  va 2 s  . c o m
    pnlImage.setOpaque(false);
    pnlImage.setBorder(BorderFactory.createCompoundBorder(raisedbevel, loweredbevel));

    pnlImage.add(this.lblVersion);

    this.lblVersion.setForeground(Color.white);
    this.lblVersion.setFont(new Font("Dialog", Font.PLAIN, 12));
    this.lblVersion.setBounds(15, 69, 120, 20);

    setContentPane(pnlImage);
    setSize(image.getIconWidth(), image.getIconHeight());
}

From source file:dpcs.UninstallSystemApps.java

@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" })
public UninstallSystemApps() {
    setResizable(false);//from w w  w .  ja v  a 2  s.  c  om
    setTitle("Uninstall System Apps");
    setIconImage(
            Toolkit.getDefaultToolkit().getImage(UninstallSystemApps.class.getResource("/graphics/Icon.png")));
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setBounds(100, 100, 482, 475);
    contentPane = new JPanel();
    contentPane.setBackground(Color.WHITE);
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);

    JLabel AppStatus = new JLabel("");
    AppStatus.setBounds(12, 393, 456, 17);
    contentPane.add(AppStatus);

    SystemAppUninstallDone = new JLabel("");
    SystemAppUninstallDone.setBounds(151, 312, 186, 56);
    contentPane.add(SystemAppUninstallDone);

    JLabel lblSelect = new JLabel("Select an app to remove");
    lblSelect.setBounds(26, 12, 405, 17);
    contentPane.add(lblSelect);

    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setBounds(22, 41, 428, 259);
    contentPane.add(scrollPane);

    final JButton btnUninstall = new JButton("Uninstall");
    btnUninstall.setToolTipText("Uninstall the selected app");
    btnUninstall.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            SystemAppUninstallDone.setText("");
            if (list.getSelectedValue() == null) {
                JOptionPane.showMessageDialog(null, "Please select an app first");
            } else {
                try {
                    AppStatus.setText("Uninstalling...");
                    Process p1 = Runtime.getRuntime().exec("adb remount");
                    p1.waitFor();
                    String[] commands = new String[3];
                    commands[0] = "adb shell su -c rm -r ";
                    commands[1] = "/system/app/";
                    commands[2] = " " + list.getSelectedValue();
                    Process p2 = Runtime.getRuntime().exec(commands, null);
                    p2.waitFor();
                    Process p3 = Runtime.getRuntime()
                            .exec("adb shell ls /system/app/ > /sdcard/.systemapps.txt");
                    p3.waitFor();
                    Process p4 = Runtime.getRuntime().exec("adb pull /sdcard/.systemapps.txt");
                    p4.waitFor();
                    Process p5 = Runtime.getRuntime().exec("adb shell rm /sdcard/.systemapps.txt");
                    p5.waitFor();
                    lines = IOUtils.readLines(new FileInputStream(".systemapps.txt"));
                    values = new String[lines.size()];
                    values = lines.toArray(values);
                    list = new JList();
                    list.setModel(new AbstractListModel() {
                        public int getSize() {
                            return values.length;
                        }

                        public Object getElementAt(int index) {
                            return values[index];
                        }
                    });
                    scrollPane.setViewportView(list);
                    File file = new File(".systemapps.txt");
                    if (file.exists() && !file.isDirectory()) {
                        file.delete();
                    }
                    AppStatus.setText("App has been uninstalled successfully");
                    SystemAppUninstallDone
                            .setIcon(new ImageIcon(Interface.class.getResource("/graphics/Smalldone.png")));
                    btnUninstall.setSelected(false);
                } catch (Exception e1) {
                    System.err.println(e1);
                }
            }
        }
    });
    btnUninstall.setBounds(26, 327, 107, 27);
    contentPane.add(btnUninstall);

    JButton btnRefresh = new JButton("Refresh");
    btnRefresh.setToolTipText("Refresh the apps list");
    btnRefresh.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            try {
                Process p1 = Runtime.getRuntime().exec("adb shell ls /system/app/ > /sdcard/.systemapps.txt");
                p1.waitFor();
                Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.systemapps.txt");
                p2.waitFor();
                Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.systemapps.txt");
                p3.waitFor();
                lines = IOUtils.readLines(new FileInputStream(".systemapps.txt"));
                values = new String[lines.size()];
                values = lines.toArray(values);
                list = new JList();
                list.setModel(new AbstractListModel() {
                    public int getSize() {
                        return values.length;
                    }

                    public Object getElementAt(int index) {
                        return values[index];
                    }
                });
                scrollPane.setViewportView(list);
                File file = new File(".systemapps.txt");
                if (file.exists() && !file.isDirectory()) {
                    file.delete();
                }
            } catch (Exception e1) {
                System.err.println(e1);
            }
        }
    });
    btnRefresh.setBounds(344, 327, 107, 27);
    contentPane.add(btnRefresh);

    try {
        Process p1 = Runtime.getRuntime().exec("adb shell ls /system/app/ > /sdcard/.systemapps.txt");
        p1.waitFor();
        Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.systemapps.txt");
        p2.waitFor();
        Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.systemapps.txt");
        p3.waitFor();
        lines = IOUtils.readLines(new FileInputStream(".systemapps.txt"));
        values = new String[lines.size()];
        values = lines.toArray(values);
        list = new JList();
        list.setModel(new AbstractListModel() {
            public int getSize() {
                return values.length;
            }

            public Object getElementAt(int index) {
                return values[index];
            }
        });
        scrollPane.setViewportView(list);
        JLabel lblNewLabel = new JLabel("Note: You should also remove app's odex file if it exists");
        lblNewLabel.setBounds(25, 374, 438, 17);
        contentPane.add(lblNewLabel);

        JLabel label = new JLabel("Needs root and does not work on production android builds!");
        label.setBounds(25, 413, 454, 17);
        contentPane.add(label);
        File file = new File(".systemapps.txt");
        if (file.exists() && !file.isDirectory()) {
            file.delete();
        }
    } catch (Exception e) {
        System.err.println(e);
    }
}

From source file:dpcs.UninstallUserApps.java

@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" })
public UninstallUserApps() {
    setResizable(false);//from ww w  . ja  va2s .c om
    setTitle("Uninstall User Apps");
    setIconImage(
            Toolkit.getDefaultToolkit().getImage(UninstallSystemApps.class.getResource("/graphics/Icon.png")));
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setBounds(100, 100, 482, 430);
    contentPane = new JPanel();
    contentPane.setBackground(Color.WHITE);
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);

    JLabel AppStatus = new JLabel("");
    AppStatus.setBounds(12, 366, 456, 17);
    contentPane.add(AppStatus);

    UserAppUninstallDone = new JLabel("");
    UserAppUninstallDone.setText("");
    UserAppUninstallDone.setBounds(151, 312, 186, 56);
    contentPane.add(UserAppUninstallDone);

    JLabel lblSelect = new JLabel("Select an app to remove");
    lblSelect.setBounds(26, 12, 405, 17);
    contentPane.add(lblSelect);

    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setBounds(22, 41, 428, 259);
    contentPane.add(scrollPane);

    final JButton btnUninstall = new JButton("Uninstall");
    btnUninstall.setToolTipText("Uninstall the selected app");
    btnUninstall.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            UserAppUninstallDone.setText("");
            if (list.getSelectedValue() == null) {
                JOptionPane.showMessageDialog(null, "Please select an app first");
            } else {
                try {
                    AppStatus.setText("Uninstalling...");
                    String[] commands = new String[3];
                    commands[0] = "adb";
                    commands[1] = "uninstall";
                    commands[2] = "" + list.getSelectedValue();
                    Process p1 = Runtime.getRuntime().exec(commands, null);
                    p1.waitFor();
                    Process p2 = Runtime.getRuntime()
                            .exec("adb shell pm list packages -3 > /sdcard/.userapps.txt");
                    p2.waitFor();
                    Process p3 = Runtime.getRuntime().exec("adb pull /sdcard/.userapps.txt");
                    p3.waitFor();
                    Process p4 = Runtime.getRuntime().exec("adb shell rm /sdcard/.userapps.txt");
                    p4.waitFor();
                    lines = IOUtils.readLines(new FileInputStream(".userapps.txt"));
                    values = new String[lines.size()];
                    values = lines.toArray(values);
                    moddedvalues = new String[values.length];
                    for (int i = 0; i < values.length; i++) {
                        moddedvalues[i] = values[i].substring(8);
                    }
                    list = new JList();
                    list.setModel(new AbstractListModel() {
                        public int getSize() {
                            return moddedvalues.length;
                        }

                        public Object getElementAt(int index) {
                            return moddedvalues[index];
                        }
                    });
                    scrollPane.setViewportView(list);
                    File file = new File(".userapps.txt");
                    if (file.exists() && !file.isDirectory()) {
                        file.delete();
                    }
                    AppStatus.setText("App has been uninstalled successfully");
                    UserAppUninstallDone
                            .setIcon(new ImageIcon(Interface.class.getResource("/graphics/Smalldone.png")));
                    btnUninstall.setSelected(false);
                } catch (Exception e1) {
                    System.err.println(e1);
                }
            }
        }
    });
    btnUninstall.setBounds(26, 327, 107, 27);
    contentPane.add(btnUninstall);

    JButton btnRefresh = new JButton("Refresh");
    btnRefresh.setToolTipText("Refresh the apps list");
    btnRefresh.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            try {
                Process p1 = Runtime.getRuntime().exec("adb shell pm list packages -3 > /sdcard/.userapps.txt");
                p1.waitFor();
                Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.userapps.txt");
                p2.waitFor();
                Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.userapps.txt");
                p3.waitFor();
                lines = IOUtils.readLines(new FileInputStream(".userapps.txt"));
                values = new String[lines.size()];
                values = lines.toArray(values);
                moddedvalues = new String[values.length];
                for (int i = 0; i < values.length; i++) {
                    moddedvalues[i] = values[i].substring(8);
                }
                list = new JList();
                list.setModel(new AbstractListModel() {
                    public int getSize() {
                        return moddedvalues.length;
                    }

                    public Object getElementAt(int index) {
                        return moddedvalues[index];
                    }
                });
                scrollPane.setViewportView(list);
                File file = new File(".userapps.txt");
                if (file.exists() && !file.isDirectory()) {
                    file.delete();
                }
            } catch (Exception e1) {
                System.err.println(e1);
            }
        }
    });
    btnRefresh.setBounds(344, 327, 107, 27);
    contentPane.add(btnRefresh);

    try {
        Process p1 = Runtime.getRuntime().exec("adb shell pm list packages -3 > /sdcard/.userapps.txt");
        p1.waitFor();
        Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.userapps.txt");
        p2.waitFor();
        Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.userapps.txt");
        p3.waitFor();
        lines = IOUtils.readLines(new FileInputStream(".userapps.txt"));
        values = new String[lines.size()];
        values = lines.toArray(values);
        moddedvalues = new String[values.length];
        for (int i = 0; i < values.length; i++) {
            moddedvalues[i] = values[i].substring(8);
        }
        list = new JList();
        list.setModel(new AbstractListModel() {
            public int getSize() {
                return moddedvalues.length;
            }

            public Object getElementAt(int index) {
                return moddedvalues[index];
            }
        });
        scrollPane.setViewportView(list);
        File file = new File(".userapps.txt");
        if (file.exists() && !file.isDirectory()) {
            file.delete();
        }
    } catch (Exception e1) {
        System.err.println(e1);
    }
}

From source file:dpcs.UninstallPrivApps.java

@SuppressWarnings({ "unchecked", "rawtypes", "deprecation" })
public UninstallPrivApps() {
    setResizable(false);// ww w  .  j a  v a2  s  . c  om
    setTitle("Uninstall Priv-apps");
    setIconImage(
            Toolkit.getDefaultToolkit().getImage(UninstallSystemApps.class.getResource("/graphics/Icon.png")));
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setBounds(100, 100, 482, 500);
    contentPane = new JPanel();
    contentPane.setBackground(Color.WHITE);
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);

    JLabel AppStatus = new JLabel("");
    AppStatus.setBounds(8, 404, 456, 17);
    contentPane.add(AppStatus);

    PrivAppUninstallDone = new JLabel("");
    PrivAppUninstallDone.setText("");
    PrivAppUninstallDone.setBounds(151, 312, 186, 56);
    contentPane.add(PrivAppUninstallDone);

    JLabel lblSelect = new JLabel("Select an app to remove");
    lblSelect.setBounds(25, 12, 405, 17);
    contentPane.add(lblSelect);

    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setBounds(22, 41, 428, 259);
    contentPane.add(scrollPane);

    final JButton btnUninstall = new JButton("Uninstall");
    btnUninstall.setToolTipText("Uninstall the selected app");
    btnUninstall.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            PrivAppUninstallDone.setText("");
            if (list.getSelectedValue() == null) {
                JOptionPane.showMessageDialog(null, "Please select an app first");
            } else {
                try {
                    AppStatus.setText("Uninstalling...");
                    Process p1 = Runtime.getRuntime().exec("adb remount");
                    p1.waitFor();
                    String[] commands = new String[3];
                    commands[0] = "adb shell su -c rm -r";
                    commands[1] = "/system/priv-app/";
                    commands[2] = " " + list.getSelectedValue();
                    Process p2 = Runtime.getRuntime().exec(commands, null);
                    p2.waitFor();
                    Process p3 = Runtime.getRuntime()
                            .exec("adb shell ls /system/priv-app/ > /sdcard/.privapps.txt");
                    p3.waitFor();
                    Process p4 = Runtime.getRuntime().exec("adb pull /sdcard/.privapps.txt");
                    p4.waitFor();
                    Process p5 = Runtime.getRuntime().exec("adb shell rm /sdcard/.privapps.txt");
                    p5.waitFor();
                    lines = IOUtils.readLines(new FileInputStream(".privapps.txt"));
                    values = new String[lines.size()];
                    values = lines.toArray(values);
                    list = new JList();
                    list.setModel(new AbstractListModel() {
                        public int getSize() {
                            return values.length;
                        }

                        public Object getElementAt(int index) {
                            return values[index];
                        }
                    });
                    scrollPane.setViewportView(list);

                    File file = new File(".privapps.txt");
                    if (file.exists() && !file.isDirectory()) {
                        file.delete();
                    }
                    AppStatus.setText("App has been uninstalled successfully");
                    PrivAppUninstallDone
                            .setIcon(new ImageIcon(Interface.class.getResource("/graphics/Smalldone.png")));
                    btnUninstall.setSelected(false);
                } catch (Exception e1) {
                    System.err.println(e1);
                }
            }
        }
    });
    btnUninstall.setBounds(26, 327, 107, 27);
    contentPane.add(btnUninstall);

    JButton btnRefresh = new JButton("Refresh");
    btnRefresh.setToolTipText("Refresh the apps list");
    btnRefresh.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            try {
                Process p1 = Runtime.getRuntime()
                        .exec("adb shell ls /system/priv-app/ > /sdcard/.privapps.txt");
                p1.waitFor();
                Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.privapps.txt");
                p2.waitFor();
                Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.privapps.txt");
                p3.waitFor();
                lines = IOUtils.readLines(new FileInputStream(".privapps.txt"));
                values = new String[lines.size()];
                values = lines.toArray(values);
                list = new JList();
                list.setModel(new AbstractListModel() {
                    public int getSize() {
                        return values.length;
                    }

                    public Object getElementAt(int index) {
                        return values[index];
                    }
                });
                scrollPane.setViewportView(list);
                File file = new File(".privapps.txt");
                if (file.exists() && !file.isDirectory()) {
                    file.delete();
                }
            } catch (Exception e1) {
                System.err.println(e1);
            }
        }
    });
    btnRefresh.setBounds(344, 327, 107, 27);
    contentPane.add(btnRefresh);

    try {
        Process p1 = Runtime.getRuntime().exec("adb shell ls /system/priv-app/ > /sdcard/.privapps.txt");
        p1.waitFor();
        Process p2 = Runtime.getRuntime().exec("adb pull /sdcard/.privapps.txt");
        p2.waitFor();
        Process p3 = Runtime.getRuntime().exec("adb shell rm /sdcard/.privapps.txt");
        p3.waitFor();
        lines = IOUtils.readLines(new FileInputStream(".privapps.txt"));
        values = new String[lines.size()];
        values = lines.toArray(values);
        list = new JList();
        list.setModel(new AbstractListModel() {
            public int getSize() {
                return values.length;
            }

            public Object getElementAt(int index) {
                return values[index];
            }
        });
        scrollPane.setViewportView(list);

        JLabel lblNewLabel = new JLabel("Note: You should also remove app's odex file if it exits ");
        lblNewLabel.setBounds(25, 374, 438, 17);
        contentPane.add(lblNewLabel);

        JLabel lblNeedsRootAnd = new JLabel("Needs root and does not work on production android builds!");
        lblNeedsRootAnd.setBounds(25, 426, 454, 17);
        contentPane.add(lblNeedsRootAnd);

        JLabel lblOnlyForAndroid = new JLabel("Uninstallation only for android 4.4.x and higher!");
        lblOnlyForAndroid.setBounds(8, 452, 450, 15);
        contentPane.add(lblOnlyForAndroid);
        File file = new File(".privapps.txt");
        if (file.exists() && !file.isDirectory()) {
            file.delete();
        }
    } catch (Exception e) {
        System.err.println(e);
    }
}

From source file:dpcs.About.java

public About() {
    setIconImage(Toolkit.getDefaultToolkit().getImage(About.class.getResource("/graphics/Icon.png")));
    setResizable(false);//from  w w w . j  a va2  s  . c o  m
    setType(Type.UTILITY);
    setTitle("About");
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    setBounds(100, 100, 540, 400);
    contentPane = new JPanel();
    contentPane.setBackground(Color.WHITE);
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);
    try {
        InputStreamReader reader2 = new InputStreamReader(
                getClass().getResourceAsStream("/others/app-version.txt"));
        String tmp = IOUtils.toString(reader2);
        AppVersion = Double.parseDouble(tmp);
    } catch (IOException e1) {
        e1.printStackTrace();
    }
    JButton btnGitHub = new JButton("GitHub");
    btnGitHub.setToolTipText("Access Droid PC Suite github repository");
    btnGitHub.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            try {
                Desktop.getDesktop().browse(new URL("https://github.com/kvsjxd/Droid-PC-Suite/").toURI());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
    btnGitHub.setBounds(369, 295, 111, 25);
    contentPane.add(btnGitHub);

    JLabel lblMyFriend4 = new JLabel("Gulati-kun");
    lblMyFriend4.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMyFriend4.setBounds(25, 266, 242, 24);
    contentPane.add(lblMyFriend4);

    JLabel lblMyFriend3 = new JLabel("Anil-kun");
    lblMyFriend3.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMyFriend3.setBounds(25, 242, 242, 24);
    contentPane.add(lblMyFriend3);

    JLabel lblMyFriend2 = new JLabel("Suri-kun");
    lblMyFriend2.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMyFriend2.setBounds(25, 217, 242, 24);
    contentPane.add(lblMyFriend2);

    JLabel lblApplicationVersion = new JLabel("Version: " + AppVersion);
    lblApplicationVersion.setFont(new Font("Dialog", Font.BOLD, 14));
    lblApplicationVersion.setBounds(382, 16, 132, 18);
    contentPane.add(lblApplicationVersion);

    JLabel lblForMyOther = new JLabel("For my other Android stuff visit me on XDA - Developers (@kvsjxd)");
    lblForMyOther.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent arg0) {
            try {
                Desktop.getDesktop().browse(new URL(
                        "http://forum.xda-developers.com/member.php?s=82fb1dacfee601c8f79084b30d57d5a2&u=5640594")
                                .toURI());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        @Override
        public void mouseEntered(MouseEvent e) {
            lblForMyOther.setForeground(Color.BLUE);
        }

        @Override
        public void mouseExited(MouseEvent e) {
            lblForMyOther.setForeground(Color.BLACK);
        }
    });
    lblForMyOther.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblForMyOther.setBounds(25, 321, 502, 24);
    contentPane.add(lblForMyOther);

    JLabel lblMySensei2 = new JLabel("Karun Sensei");
    lblMySensei2.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMySensei2.setBounds(25, 120, 242, 24);
    contentPane.add(lblMySensei2);

    JLabel lblMySensei1 = new JLabel("Prashotam Sensei");
    lblMySensei1.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMySensei1.setBounds(25, 98, 242, 24);
    contentPane.add(lblMySensei1);

    JLabel lblDaretobe = new JLabel("D4r3T0B3");
    lblDaretobe.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblDaretobe.setBounds(25, 194, 242, 24);
    contentPane.add(lblDaretobe);

    JLabel label_9 = new JLabel("");
    label_9.setToolTipText("This variation of android robot is created using Androidify");
    label_9.setIcon(new ImageIcon(About.class.getResource("/graphics/Droidrobot.png")));
    label_9.setBounds(334, 50, 180, 270);
    contentPane.add(label_9);

    JLabel lblDeveloper = new JLabel("Developer");
    lblDeveloper.setFont(new Font("Dialog", Font.BOLD, 16));
    lblDeveloper.setBounds(25, 12, 233, 24);
    contentPane.add(lblDeveloper);

    JLabel lblMrAleksandarDespotovski_shi = new JLabel("Aleksandar Despotovski-shi");
    lblMrAleksandarDespotovski_shi.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMrAleksandarDespotovski_shi.setBounds(25, 169, 242, 24);
    contentPane.add(lblMrAleksandarDespotovski_shi);

    JLabel lblMyname = new JLabel("Karanvir Singh");
    lblMyname.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            try {
                Desktop.getDesktop().browse(new URL(
                        "http://forum.xda-developers.com/member.php?s=82fb1dacfee601c8f79084b30d57d5a2&u=5640594")
                                .toURI());
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        }

        @Override
        public void mouseEntered(MouseEvent e) {
            lblMyname.setForeground(Color.BLUE);
        }

        @Override
        public void mouseExited(MouseEvent e) {
            lblMyname.setForeground(Color.RED);
        }
    });
    lblMyname.setForeground(Color.RED);
    lblMyname.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 16));
    lblMyname.setBounds(25, 36, 242, 24);
    contentPane.add(lblMyname);

    JLabel lblMyFriend1 = new JLabel("My friend - Chetan-kun");
    lblMyFriend1.setFont(new Font("Dialog", Font.PLAIN, 15));
    lblMyFriend1.setBounds(25, 145, 242, 24);
    contentPane.add(lblMyFriend1);

    JLabel label_6 = new JLabel("Special thanks to");
    label_6.setForeground(UIManager.getColor("OptionPane.questionDialog.titlePane.shadow"));
    label_6.setFont(new Font("Dialog", Font.BOLD, 16));
    label_6.setBounds(25, 71, 240, 25);
    contentPane.add(label_6);

    JLabel lblGoogle = new JLabel(
            "Android, android green colored robot are trademarks of Google, Inc. We are not affliated with Google, Inc. in any way.");
    lblGoogle.setHorizontalAlignment(SwingConstants.LEFT);
    lblGoogle.setFont(new Font("Dialog", Font.PLAIN, 8));
    lblGoogle.setBounds(25, 341, 514, 24);
    contentPane.add(lblGoogle);
}

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

/**
 * Initialize the contents of the frame.
 *///w ww  .  j  av  a 2s . c  om
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:LayeredPaneDemo.java

private JLabel createColoredLabel(String text, Color color, Point origin) {
    JLabel label = new JLabel(text);
    label.setVerticalAlignment(JLabel.TOP);
    label.setHorizontalAlignment(JLabel.CENTER);
    label.setOpaque(true);//from   w w w .j  a  v  a2 s.  co m
    label.setBackground(color);
    label.setForeground(Color.black);
    label.setBorder(BorderFactory.createLineBorder(Color.black));
    label.setBounds(origin.x, origin.y, 140, 140);
    return label;
}

From source file:analisisnumerico.Main.java

public Main() {
    setTitle("Analisis Numerico");
    setBounds(145, 80, 780, 480);/*from  ww w.j a  v  a  2 s  . c o m*/
    this.setUndecorated(true);
    initComponents();
    jPanel2.setBackground(new Color(219, 68, 55));
    JLabel text = new JLabel("Analisis Numerico");
    text.setBounds(14, 0, 160, 40);
    text.setForeground(Color.WHITE);
    jPanel2.add(text);
    jButton1.setSize(20, 20);
    jButton2.setSize(20, 20);
    Fondo f = new Fondo();
    jPanel1.add(f);
    m.setBounds(0, 0, 780, 480);
    f.add(m);
    jButton2.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            setExtendedState(ICONIFIED);
        }
    });
    jButton2.setVisible(true);
    jButton1.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            System.exit(0);
        }
    });
    jButton1.setVisible(true);

    jButton6.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Biseccion s = new Biseccion(F);
            f.removeAll();
            s.setBounds(0, 0, 780, 480);
            f.add(s);
            f.setVisible(true);
            f.updateUI();
        }
    });

    jButton7.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Secante s = new Secante(F);
            f.removeAll();
            s.setBounds(0, 0, 780, 480);
            f.add(s);
            f.setVisible(true);
            f.updateUI();
        }
    });

    jButton3.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Menu m = new Menu(F);
            f.removeAll();
            m.setBounds(0, 0, 780, 480);
            f.add(m);
            f.setVisible(true);
            f.updateUI();
        }
    });

    jButton8.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Newton n = new Newton(F);
            f.removeAll();
            n.setBounds(0, 0, 780, 480);
            f.add(n);
            f.setVisible(true);
            f.updateUI();
        }
    });
    jButton5.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            Grafica g = new Grafica(F);
            f.removeAll();
            g.setBounds(0, 0, 780, 480);
            f.add(g);
            f.setVisible(true);
            f.updateUI();

        }
    });
    jButton4.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            SistemasEcuaciones m = new SistemasEcuaciones();
            f.removeAll();
            m.setBounds(0, 0, 780, 480);
            f.add(m);
            f.setVisible(true);
            f.updateUI();
        }
    });
}

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

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