Search in sources :

Example 61 with JPanel

use of javax.swing.JPanel in project pcgen by PCGen.

the class NotesView method initComponents.

/**
	 *  This method is called from within the constructor to initialize the form.
	 *  WARNING: Do NOT modify this code. The content of this method is always
	 *  regenerated by the Form Editor.
	 */
private void initComponents() {
    //GEN-BEGIN:initComponents
    jSplitPane1 = new FlippingSplitPane();
    jScrollPane1 = new JScrollPane();
    notesTree = new JTree();
    jPanel1 = new JPanel();
    jScrollPane2 = new JScrollPane();
    editor = new JTextPane();
    jPanel2 = new JPanel();
    fileBar = new JToolBar();
    newButton = new JButton();
    saveButton = new JButton();
    exportButton = new JButton();
    revertButton = new JButton();
    deleteButton = new JButton();
    clipboardBar = new JToolBar();
    cutButton = new JButton();
    copyButton = new JButton();
    pasteButton = new JButton();
    formatBar = new JToolBar();
    sizeCB = new JComboBox();
    boldButton = new JButton();
    italicButton = new JButton();
    underlineButton = new JButton();
    colorButton = new JButton();
    bulletButton = new JButton();
    enumButton = new JButton();
    imageButton = new JButton();
    alignmentBar = new JToolBar();
    leftJustifyButton = new JButton();
    centerJustifyButton = new JButton();
    rightJustifyButton = new JButton();
    filePane = new JPanel();
    fileLeft = new JButton();
    fileRight = new JButton();
    filesBar = new JToolBar();
    setLayout(new java.awt.BorderLayout());
    jSplitPane1.setDividerLocation(175);
    jSplitPane1.setDividerSize(5);
    jScrollPane1.setViewportView(notesTree);
    jSplitPane1.setLeftComponent(jScrollPane1);
    jPanel1.setLayout(new java.awt.BorderLayout());
    editor.addCaretListener(this::editorCaretUpdate);
    jScrollPane2.setViewportView(editor);
    jPanel1.add(jScrollPane2, java.awt.BorderLayout.CENTER);
    jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 0));
    newButton.setIcon(Icons.stock_new.getImageIcon());
    newButton.setToolTipText("New Node");
    newButton.setBorder(new EtchedBorder());
    newButton.setEnabled(false);
    newButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            newButtonActionPerformed();
        }
    });
    fileBar.add(newButton);
    saveButton.setIcon(Icons.stock_save.getImageIcon());
    saveButton.setToolTipText("Save Node");
    saveButton.setBorder(new EtchedBorder());
    saveButton.setEnabled(false);
    saveButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveButtonActionPerformed();
        }
    });
    fileBar.add(saveButton);
    exportButton.setIcon(Icons.stock_export.getImageIcon());
    exportButton.setToolTipText("Export");
    exportButton.setBorder(new EtchedBorder());
    exportButton.setEnabled(false);
    exportButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            exportButtonActionPerformed();
        }
    });
    fileBar.add(exportButton);
    revertButton.setIcon(Icons.stock_revert.getImageIcon());
    revertButton.setToolTipText("Revert to Saved");
    revertButton.setBorder(new EtchedBorder());
    revertButton.setEnabled(false);
    revertButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            revertButtonActionPerformed();
        }
    });
    fileBar.add(revertButton);
    deleteButton.setIcon(Icons.stock_broken_image.getImageIcon());
    deleteButton.setToolTipText("Delete Node");
    deleteButton.setBorder(new EtchedBorder());
    deleteButton.setEnabled(false);
    deleteButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteButtonActionPerformed();
        }
    });
    fileBar.add(deleteButton);
    jPanel2.add(fileBar);
    cutButton.setIcon(Icons.stock_cut.getImageIcon());
    cutButton.setToolTipText("Cut");
    cutButton.setBorder(new EtchedBorder());
    cutButton.addActionListener(this::cutButtonActionPerformed);
    clipboardBar.add(cutButton);
    copyButton.setIcon(Icons.stock_copy.getImageIcon());
    copyButton.setToolTipText("Copy");
    copyButton.setBorder(new EtchedBorder());
    copyButton.addActionListener(this::copyButtonActionPerformed);
    clipboardBar.add(copyButton);
    pasteButton.setIcon(Icons.stock_paste.getImageIcon());
    pasteButton.setToolTipText("Paste");
    pasteButton.setBorder(new EtchedBorder());
    pasteButton.addActionListener(this::pasteButtonActionPerformed);
    clipboardBar.add(pasteButton);
    jPanel2.add(clipboardBar);
    sizeCB.setToolTipText("Size");
    sizeCB.setBorder(new EtchedBorder());
    sizeCB.addActionListener(this::sizeCBActionPerformed);
    formatBar.add(sizeCB);
    boldButton.setIcon(Icons.stock_text_bold.getImageIcon());
    boldButton.setToolTipText("Bold");
    boldButton.setBorder(new EtchedBorder());
    boldButton.addActionListener(this::boldButtonActionPerformed);
    formatBar.add(boldButton);
    italicButton.setIcon(Icons.stock_text_italic.getImageIcon());
    italicButton.setToolTipText("Italic");
    italicButton.setBorder(new EtchedBorder());
    italicButton.addActionListener(this::italicButtonActionPerformed);
    formatBar.add(italicButton);
    underlineButton.setIcon(Icons.stock_text_underline.getImageIcon());
    underlineButton.setToolTipText("Underline");
    underlineButton.setBorder(new EtchedBorder());
    underlineButton.addActionListener(this::underlineButtonActionPerformed);
    formatBar.add(underlineButton);
    colorButton.setForeground(new java.awt.Color(0, 0, 0));
    colorButton.setIcon(Icons.createImageIcon("menu-mode-RGB-alt.png"));
    colorButton.setToolTipText("Color");
    colorButton.setBorder(new EtchedBorder());
    colorButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            colorButtonActionPerformed();
        }
    });
    formatBar.add(colorButton);
    bulletButton.setIcon(Icons.stock_list_bulet.getImageIcon());
    bulletButton.setToolTipText("Bulleted List");
    bulletButton.setAction(actionListUnordered);
    bulletButton.setBorder(new EtchedBorder());
    formatBar.add(bulletButton);
    enumButton.setIcon(Icons.stock_list_enum.getImageIcon());
    enumButton.setToolTipText("Numbered List");
    enumButton.setAction(actionListOrdered);
    enumButton.setBorder(new EtchedBorder());
    formatBar.add(enumButton);
    imageButton.setIcon(Icons.stock_insert_graphic.getImageIcon());
    imageButton.setBorder(new EtchedBorder());
    imageButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            imageButtonActionPerformed();
        }
    });
    formatBar.add(imageButton);
    jPanel2.add(formatBar);
    leftJustifyButton.setIcon(Icons.stock_text_align_left.getImageIcon());
    leftJustifyButton.setToolTipText("Left Justify");
    leftJustifyButton.setBorder(new EtchedBorder());
    leftJustifyButton.addActionListener(this::leftJustifyButtonActionPerformed);
    alignmentBar.add(leftJustifyButton);
    centerJustifyButton.setIcon(Icons.stock_text_align_center.getImageIcon());
    centerJustifyButton.setToolTipText("Center");
    centerJustifyButton.setBorder(new EtchedBorder());
    centerJustifyButton.addActionListener(this::centerJustifyButtonActionPerformed);
    alignmentBar.add(centerJustifyButton);
    rightJustifyButton.setIcon(Icons.stock_text_align_right.getImageIcon());
    rightJustifyButton.setToolTipText("Right Justify");
    rightJustifyButton.setBorder(new EtchedBorder());
    rightJustifyButton.addActionListener(this::rightJustifyButtonActionPerformed);
    alignmentBar.add(rightJustifyButton);
    jPanel2.add(alignmentBar);
    jPanel1.add(jPanel2, java.awt.BorderLayout.NORTH);
    filePane.setLayout(new BoxLayout(filePane, BoxLayout.X_AXIS));
    fileLeft.setText("<");
    fileLeft.setBorder(new EtchedBorder());
    fileLeft.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            fileLeftActionPerformed();
        }
    });
    filePane.add(fileLeft);
    fileRight.setText(">");
    fileRight.setBorder(new EtchedBorder());
    fileRight.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            fileRightActionPerformed();
        }
    });
    filePane.add(fileRight);
    filePane.add(filesBar);
    jPanel1.add(filePane, java.awt.BorderLayout.SOUTH);
    jSplitPane1.setRightComponent(jPanel1);
    add(jSplitPane1, java.awt.BorderLayout.CENTER);
}
Also used : JScrollPane(javax.swing.JScrollPane) Color(java.awt.Color) JPanel(javax.swing.JPanel) ActionListener(java.awt.event.ActionListener) JComboBox(javax.swing.JComboBox) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) JToolBar(javax.swing.JToolBar) FlippingSplitPane(gmgen.gui.FlippingSplitPane) ActionEvent(java.awt.event.ActionEvent) JTextPane(javax.swing.JTextPane) JTree(javax.swing.JTree) EtchedBorder(javax.swing.border.EtchedBorder)

Example 62 with JPanel

use of javax.swing.JPanel in project ACS by ACS-Community.

the class LogLevelSelectorPanel method initAllLoggersPanel.

/**
	 * Setup the panel with the option for all the named loggers
	 * 
	 * @return
	 * @throws AcsJCORBAProblemEx 
	 */
private JPanel initAllLoggersPanel() throws AcsJCORBAProblemEx {
    TitledBorder border = BorderFactory.createTitledBorder("Process wide default log levels");
    JPanel mainPnl = new JPanel();
    GridBagLayout gl = new GridBagLayout();
    GridBagConstraints gc = new GridBagConstraints();
    mainPnl.setLayout(gl);
    mainPnl.setBorder(border);
    JLabel localLbl = new JLabel("Default local log level");
    allLocalCB.setRenderer(editorLocal);
    JLabel globalLbl = new JLabel("Default remote log level");
    allGlobalCB.setRenderer(editorGlobal);
    gc.insets = new Insets(5, 5, 5, 5);
    gc.gridx = 0;
    gc.gridy = 0;
    gl.setConstraints(localLbl, gc);
    mainPnl.add(localLbl);
    gc.gridx++;
    gl.setConstraints(allLocalCB, gc);
    mainPnl.add(allLocalCB);
    gc.gridx++;
    gl.setConstraints(globalLbl, gc);
    mainPnl.add(globalLbl);
    gc.gridx++;
    gl.setConstraints(allGlobalCB, gc);
    mainPnl.add(allGlobalCB);
    gc.gridx = 0;
    gc.gridy++;
    gc.gridwidth = GridBagConstraints.REMAINDER;
    gl.setConstraints(defaultBtn, gc);
    mainPnl.add(defaultBtn);
    // Set the listeners
    defaultBtn.addActionListener(this);
    allLocalCB.addActionListener(this);
    allGlobalCB.addActionListener(this);
    // set initial choices
    refreshAllLoggersPanel();
    return mainPnl;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) TitledBorder(javax.swing.border.TitledBorder)

Example 63 with JPanel

use of javax.swing.JPanel in project ACS by ACS-Community.

the class ManagerBusyDlg method initialize.

private void initialize(String msg) {
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    msgLbl.setText(msg);
    JPanel msgPnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
    msgPnl.add(msgLbl);
    add(msgPnl, BorderLayout.NORTH);
    JProgressBar bar = new JProgressBar();
    bar.setPreferredSize(new Dimension(150, 25));
    add(bar, BorderLayout.CENTER);
    JPanel btnPnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
    btnPnl.add(stopBtn);
    stopBtn.addActionListener(this);
    add(btnPnl, BorderLayout.SOUTH);
    setLocation(50, 50);
    pack();
    setVisible(true);
    bar.setIndeterminate(true);
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JProgressBar(javax.swing.JProgressBar) Dimension(java.awt.Dimension)

Example 64 with JPanel

use of javax.swing.JPanel in project ACS by ACS-Community.

the class DateTimeSelector method initGUI.

/**
	 * Init the GUI
	 */
private void initGUI() {
    // YearCB is initialized from 2000 to the year next to this on
    Calendar cal = Calendar.getInstance();
    int year = cal.get(Calendar.YEAR);
    for (int t = 2000; t <= cal.get(Calendar.YEAR) + 1; t++) {
        yearCB.addItem(Integer.valueOf(t));
    }
    // Month
    for (int t = 1; t <= 12; t++) {
        monthCB.addItem(Integer.valueOf(t));
    }
    //dayCB.setModel(new DayComboBoxModel());
    for (int t = 1; t <= 31; t++) {
        dayCB.addItem(Integer.valueOf(t));
    }
    // hour
    for (int t = 0; t < 24; t++) {
        hoursCB.addItem(Integer.valueOf(t));
    }
    // Minutes and seconds
    for (int t = 0; t < 60; t++) {
        secsCB.addItem(Integer.valueOf(t));
        minsCB.addItem(Integer.valueOf(t));
    }
    // Add the date panel
    JPanel datePnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
    datePnl.setBorder(BorderFactory.createTitledBorder("Date"));
    datePnl.add(new JLabel("Day: "));
    datePnl.add(dayCB);
    datePnl.add(new JLabel("Month: "));
    datePnl.add(monthCB);
    datePnl.add(new JLabel("Year: "));
    datePnl.add(yearCB);
    // Add the time panel 
    JPanel timePnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
    timePnl.setBorder(BorderFactory.createTitledBorder("Time"));
    timePnl.add(new JLabel("Hour: "));
    timePnl.add(hoursCB);
    timePnl.add(new JLabel("Minute: "));
    timePnl.add(minsCB);
    timePnl.add(new JLabel("Second: "));
    timePnl.add(secsCB);
    // Add the widgets to the component
    setLayout(new BorderLayout());
    add(datePnl, BorderLayout.NORTH);
    add(timePnl, BorderLayout.SOUTH);
    for (JComboBox box : comboBoxes) {
        box.setEditable(false);
        // Initial selection that will be updated by the next setDate
        //
        // Do not add the action listener before selecting a item because actionPerformed calls #ratioDayCB
        // that needs to get a selected item.
        box.setSelectedIndex(0);
        box.addActionListener(this);
    }
    setDate(cal);
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) JComboBox(javax.swing.JComboBox) Calendar(java.util.Calendar) JLabel(javax.swing.JLabel)

Example 65 with JPanel

use of javax.swing.JPanel in project ACS by ACS-Community.

the class BeanGrouper method createDelPropWindow.

private void createDelPropWindow() {
    if (frame != null) {
        return;
    }
    JLabel delLabel = new JLabel("Select the Component:Property to delete:");
    jcombo = new JComboBox();
    frame = new JFrame("Delete");
    JPanel panel = new JPanel(new BorderLayout(5, 5));
    JButton delButton = new JButton("Delete");
    for (DataPrinter wp : samplers) {
        jcombo.addItem(wp.component + ":" + wp.property);
    }
    delButton.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(ActionEvent e) {
            String[] comProp = new String[2];
            comProp = jcombo.getSelectedItem().toString().split(":");
            removeSamp(comProp[0], comProp[1]);
            jcombo.removeItemAt(jcombo.getSelectedIndex());
            addToStatusList(comProp[0] + "#" + comProp[1] + "removed");
        }
    });
    delLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    panel.add(delLabel, BorderLayout.NORTH);
    jcombo.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    panel.add(jcombo, BorderLayout.CENTER);
    delButton.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    panel.add(delButton, BorderLayout.EAST);
    //frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
    frame.add(panel);
    frame.pack();
    frame.setVisible(true);
    frame.addWindowListener(new java.awt.event.WindowListener() {

        @Override
        public void windowActivated(WindowEvent e) {
        }

        @Override
        public void windowClosed(WindowEvent e) {
        }

        @Override
        public void windowClosing(WindowEvent e) {
        }

        @Override
        public void windowDeactivated(WindowEvent e) {
            frame = null;
        }

        @Override
        public void windowDeiconified(WindowEvent e) {
        }

        @Override
        public void windowIconified(WindowEvent e) {
        }

        @Override
        public void windowOpened(WindowEvent e) {
        }
    });
}
Also used : JPanel(javax.swing.JPanel) JComboBox(javax.swing.JComboBox) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) BorderLayout(java.awt.BorderLayout) JFrame(javax.swing.JFrame) WindowListener(java.awt.event.WindowListener) WindowEvent(java.awt.event.WindowEvent)

Aggregations

JPanel (javax.swing.JPanel)4487 JLabel (javax.swing.JLabel)1843 BorderLayout (java.awt.BorderLayout)1461 JButton (javax.swing.JButton)1180 Dimension (java.awt.Dimension)1107 GridBagLayout (java.awt.GridBagLayout)1071 ActionEvent (java.awt.event.ActionEvent)1019 GridBagConstraints (java.awt.GridBagConstraints)954 JScrollPane (javax.swing.JScrollPane)901 ActionListener (java.awt.event.ActionListener)871 BoxLayout (javax.swing.BoxLayout)801 Insets (java.awt.Insets)724 FlowLayout (java.awt.FlowLayout)667 JTextField (javax.swing.JTextField)532 JCheckBox (javax.swing.JCheckBox)458 GridLayout (java.awt.GridLayout)375 JComboBox (javax.swing.JComboBox)267 EmptyBorder (javax.swing.border.EmptyBorder)252 JTable (javax.swing.JTable)224 Color (java.awt.Color)210