Package charvax.swing

Examples of charvax.swing.JPanel


        menubar.add(jMenuEvents);
        menubar.add(jMenuThreads);

        setJMenuBar(menubar);

        JPanel labelPanel = new JPanel();
        labelPanel.setLayout(new BoxLayout(labelPanel, BoxLayout.Y_AXIS));
        labelPanel.add(new JLabel(
                "Use LEFT and RIGHT cursor keys to select a menu."));
        labelPanel.add(new JLabel("Use ENTER to invoke a menu or menu-item."));
        labelPanel.add(new JLabel("(You can also use the "
                + "underlined \"mnemonic key\" to invoke a menu.)"));
        labelPanel.add(new JLabel("Use BACKSPACE or ESC to dismiss a menu."));
        contentPane.add(labelPanel, BorderLayout.SOUTH);

        setLocation(0, 0);
        Toolkit tk = Toolkit.getDefaultToolkit();
        setSize(tk.getScreenColumns(), tk.getScreenRows());
View Full Code Here


        JLabel label0 = new JLabel(
                "Demonstrates how to lay components out manually");
        contentPane.add(label0);
        label0.setLocation(2, 2);

        JPanel panel1 = new JPanel();
        panel1.setLayout(null);
        contentPane.add(panel1);
        panel1.setLocation(2, 3);
        panel1.setSize(40, 6);
        panel1.setBorder(new TitledBorder("Panel1"));

        JLabel label1 = new JLabel("Label 1:");
        panel1.add(label1);
        label1.setLocation(1, 2);

        JTextField textfield1 = new JTextField("Text Field 1");
        panel1.add(textfield1);
        textfield1.setLocation(11, 2);

        JPanel panel2 = new JPanel();
        panel2.setLayout(null);
        contentPane.add(panel2);
        panel2.setLocation(2, 10);
        panel2.setSize(40, 6);
        panel2.setBorder(new TitledBorder("Panel2"));

        JLabel label2 = new JLabel("Label 2:");
        panel2.add(label2);
        label2.setLocation(1, 2);

        JTextField textfield2 = new JTextField("Text Field 2");
        panel2.add(textfield2);
        textfield2.setLocation(11, 2);

        JButton okButton = new JButton("OK");
        okButton.addActionListener(this);
        contentPane.add(okButton);
View Full Code Here

    class DevicePane extends JPanel {

        public DevicePane() {
            setLayout(new BorderLayout());

            JPanel northpan = new JPanel();
            JRadioButton button1 = new JRadioButton("View devices by type");
            JRadioButton button2 = new JRadioButton(
                    "View devices by connection");
            ButtonGroup buttons = new ButtonGroup();
            buttons.add(button1);
            buttons.add(button2);
            button1.setSelected(true);
            northpan.add(button1);
            northpan.add(button2);

            JPanel centerpan = new JPanel();
            String[] devices = { "Computer", "CD-ROM", "Disk drives",
                    "Display adapters", "Floppy disk controllers",
                    "Imaging devices", "Keyboard", "Modem", "Monitors", "Mouse"};
            JList deviceList = new JList(devices);
            deviceList.setBorder(new TitledBorder("Devices"));
            centerpan.add(deviceList);

            JPanel southpan = new JPanel();
            southpan.add(new JButton("Properties"));
            southpan.add(new JButton("Refresh"));
            southpan.add(new JButton("Remove"));
            southpan.add(new JButton("Print..."));

            add(northpan, BorderLayout.NORTH);
            add(centerpan, BorderLayout.CENTER);
            add(southpan, BorderLayout.SOUTH);
            pack();
View Full Code Here

    class PerformancePane extends JPanel {

        public PerformancePane() {
            setLayout(new BorderLayout());

            JPanel centerpan = new JPanel();
            centerpan.setBorder(new TitledBorder("Performance Status"));
            centerpan.setLayout(new BoxLayout(centerpan, BoxLayout.Y_AXIS));
            centerpan.add(new JLabel("Memory:           256.0 MB of RAM"));
            centerpan.add(new JLabel("System Resources: 50% free"));
            centerpan.add(new JLabel("File System:      32 bit"));
            centerpan.add(new JLabel("Virtual Memory:   32 bit"));
            centerpan.add(new JLabel("Disk Compression: Not Installed"));
            centerpan.add(new JLabel(
                    "Your system is configured for optimum performance"));

            JPanel southpan = new JPanel();
            southpan.setBorder(new TitledBorder("Advanced Settings"));
            southpan.add(new JButton("File System..."));
            southpan.add(new JButton("Graphics..."));
            southpan.add(new JButton("Virtual Memory..."));

            add(centerpan, BorderLayout.CENTER);
            add(southpan, BorderLayout.SOUTH);
            pack();
        }
View Full Code Here

    TextWidgetTest(Frame owner_) {
        super(owner_, "Text Widget Test");
        Container contentPane = getContentPane();

        JPanel centerpan = new JPanel();
        centerpan.setLayout(new GridBagLayout());

        GridBagConstraints gbc = new GridBagConstraints();

        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.gridwidth = 1;
        gbc.gridheight = 1;
        centerpan.add(new TextFieldPanel(), gbc);

        gbc.gridx = 1;
        centerpan.add(new PasswordFieldPanel(), gbc);

        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 2;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        centerpan.add(new TextAreaPanel(), gbc);

        JPanel southpan = new JPanel();
        JButton okButton = new JButton("OK");
        okButton.addActionListener(this);
        southpan.add(okButton);

        contentPane.add(centerpan, BorderLayout.CENTER);
        contentPane.add(southpan, BorderLayout.SOUTH);
        pack();
    }
View Full Code Here

        TextFieldPanel() {
            setLayout(new BorderLayout());
            setBorder(new TitledBorder("JTextField"));

            JPanel northpan = new JPanel();
            _enabledCb = new JCheckBox("Enabled");
            _enabledCb.setSelected(true);
            _enabledCb.addItemListener(this);
            northpan.add(_enabledCb);
            _visibleCb = new JCheckBox("Visible");
            _visibleCb.setSelected(true);
            _visibleCb.addItemListener(this);
            northpan.add(_visibleCb);

            JPanel southpan = new JPanel();
            _textfield = new JTextField("This is some text.....");
            _textfield.setBorder(new EmptyBorder(1, 1, 1, 1));
            southpan.add(_textfield);

            add(northpan, BorderLayout.NORTH);
            add(southpan, BorderLayout.SOUTH);
        }
View Full Code Here

        PasswordFieldPanel() {
            setLayout(new BorderLayout());
            setBorder(new TitledBorder("JPasswordField"));

            JPanel northpan = new JPanel();
            _enabledCb = new JCheckBox("Enabled");
            _enabledCb.setSelected(true);
            _enabledCb.addItemListener(this);
            northpan.add(_enabledCb);
            _visibleCb = new JCheckBox("Visible");
            _visibleCb.setSelected(true);
            _visibleCb.addItemListener(this);
            northpan.add(_visibleCb);

            JPanel southpan = new JPanel();
            _textfield = new JPasswordField("This is some text.....");
            _textfield.setBorder(new EmptyBorder(1, 1, 1, 1));
            southpan.add(_textfield);

            add(northpan, BorderLayout.NORTH);
            add(southpan, BorderLayout.SOUTH);
        }
View Full Code Here

        TextAreaPanel() {
            setLayout(new BorderLayout());
            setBorder(new TitledBorder("JTextArea in a JScrollPane"));

            JPanel northpan = new JPanel();
            _linewrap = new JCheckBox("Line Wrap ");
            _linewrap.setSelected(false);
            _linewrap.addItemListener(this);
            northpan.add(_linewrap);
            _linewrapstyle = new JCheckBox("Line Wrap Style = Word");
            _linewrapstyle.setSelected(false);
            _linewrapstyle.setEnabled(false);
            _linewrapstyle.addItemListener(this);
            northpan.add(_linewrapstyle);

            _textarea = new JTextArea("Contents of the JTextArea...", 8, 50);
            JScrollPane scrollpane = new JScrollPane(_textarea);
            scrollpane.setViewportBorder(new TitledBorder("Text Area"));
View Full Code Here

    SelectionTest(Frame owner_) {
        super(owner_, "JComboBox and JList");
        Container contentPane = getContentPane();

        JPanel northpan = new ComboBoxPanel();

        JPanel centerpan = new JListPanel();

        JPanel southpan = new JPanel();
        JButton okButton = new JButton("OK");
        okButton.addActionListener(this);
        southpan.add(okButton);

        contentPane.add(northpan, BorderLayout.NORTH);
        contentPane.add(centerpan, BorderLayout.CENTER);
        contentPane.add(southpan, BorderLayout.SOUTH);
        pack();
View Full Code Here

            _comboBox = new JComboBox(colors);
            _comboBox.setMaximumRowCount(5);
            _comboBox.addItemListener(this);
            add(_comboBox, BorderLayout.CENTER);

            JPanel southpan = new JPanel();
            southpan.add(new JLabel(" Selected item is: "));
            _comboBoxSelection = new JTextField(15);
            _comboBoxSelection.setEnabled(false);
            southpan.add(_comboBoxSelection);
            add(southpan, BorderLayout.SOUTH);
        }
View Full Code Here

TOP

Related Classes of charvax.swing.JPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.