Example usage for javax.swing.border SoftBevelBorder SoftBevelBorder

List of usage examples for javax.swing.border SoftBevelBorder SoftBevelBorder

Introduction

In this page you can find the example usage for javax.swing.border SoftBevelBorder SoftBevelBorder.

Prototype

public SoftBevelBorder(int bevelType) 

Source Link

Document

Creates a bevel border with the specified type and whose colors will be derived from the background color of the component passed into the paintBorder method.

Usage

From source file:com.prodigy4440.view.MainJFrame.java

public final void initComponents() {

    List<Image> icons = new LinkedList<>();
    icons.add(new ImageIcon(getClass().getResource("/com/prodigy4440/ited16x16.png")).getImage());
    icons.add(new ImageIcon(getClass().getResource("/com/prodigy4440/ited32x32.png")).getImage());
    icons.add(new ImageIcon(getClass().getResource("/com/prodigy4440/ited48x48.png")).getImage());
    icons.add(new ImageIcon(getClass().getResource("/com/prodigy4440/ited72x72.png")).getImage());

    this.setIconImages(icons);

    ActionHandler actionHandler = new ActionHandler(this);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setSize(620, 520);
    this.setLocationRelativeTo(null);
    this.setTitle("Untitled Document- IgboTextEditor");
    southJPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    SoftBevelBorder sbb = new SoftBevelBorder(SoftBevelBorder.LOWERED);
    southJPanel.setBorder(sbb);//w  w  w .  ja  v  a  2s.c  om
    menuBar = new JMenuBar();

    fileJMenu = new JMenu("File");
    fileJMenu.setMnemonic('F');
    editJMenu = new JMenu("Edit");
    editJMenu.setMnemonic('E');
    formatJMenu = new JMenu("Format");
    formatJMenu.setMnemonic('A');
    viewJMenu = new JMenu("View");
    viewJMenu.setMnemonic('V');
    helpJMenu = new JMenu("Help");
    helpJMenu.setMnemonic('H');

    newDocumentJMenuItem = new JMenuItem("New");
    newDocumentJMenuItem.addActionListener(actionHandler);
    newDocumentJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, Event.CTRL_MASK));
    openJMenuItem = new JMenuItem("Open");
    openJMenuItem.addActionListener(actionHandler);
    openJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Event.CTRL_MASK));
    saveJMenuItem = new JMenuItem("Save");
    saveJMenuItem.addActionListener(actionHandler);
    saveJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.CTRL_MASK));
    printJMenuItem = new JMenuItem("Print");
    printJMenuItem.addActionListener(actionHandler);
    printJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, Event.CTRL_MASK));
    exitJMenuItem = new JMenuItem("Exit");
    exitJMenuItem.addActionListener(actionHandler);

    undoJMenuItem = new JMenuItem("Undo");
    undoJMenuItem.addActionListener(actionHandler);
    undoJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, Event.CTRL_MASK));
    redoJMenuItem = new JMenuItem("Redo");
    redoJMenuItem.addActionListener(actionHandler);
    redoJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, Event.CTRL_MASK));
    copyJMenuItem = new JMenuItem("Copy");
    copyJMenuItem.addActionListener(actionHandler);
    copyJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, Event.CTRL_MASK));
    cutJMenuItem = new JMenuItem("Cut");
    cutJMenuItem.addActionListener(actionHandler);
    cutJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK));
    pasteJMenuItem = new JMenuItem("Paste");
    pasteJMenuItem.addActionListener(actionHandler);
    pasteJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, Event.CTRL_MASK));
    deleteJMenuItem = new JMenuItem("Delete");
    deleteJMenuItem.addActionListener(actionHandler);
    deleteJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, Event.CTRL_MASK));
    selectAllJMenuItem = new JMenuItem("Select All");
    selectAllJMenuItem.addActionListener(actionHandler);
    selectAllJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, Event.CTRL_MASK));
    findJMenuItem = new JMenuItem("Find");
    findJMenuItem.addActionListener(actionHandler);
    findJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, Event.CTRL_MASK));
    replaceJMenuItem = new JMenuItem("Replace");
    replaceJMenuItem.addActionListener(actionHandler);
    replaceJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, Event.CTRL_MASK));

    wordWrapJCheckBoxMenuItem = new JCheckBoxMenuItem("Word Wrap");
    wordWrapJCheckBoxMenuItem.addActionListener(actionHandler);
    wordWrapJCheckBoxMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, Event.CTRL_MASK));
    fontJMenuItem = new JMenuItem("Font");
    fontJMenuItem.addActionListener(actionHandler);
    colorJMenuItem = new JMenuItem("Color");
    colorJMenuItem.addActionListener(actionHandler);

    statusBarJCheckBoxMenuItem = new JCheckBoxMenuItem("Status Bar");
    statusBarJCheckBoxMenuItem.addActionListener(actionHandler);
    statusBarJCheckBoxMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, Event.ALT_MASK));

    helpJMenuItem = new JMenuItem("Help");
    helpJMenuItem.addActionListener(actionHandler);
    helpJMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, Event.CTRL_MASK));
    aboutJMenuItem = new JMenuItem("About");
    aboutJMenuItem.addActionListener(actionHandler);

    statusJLabel = new JLabel("Status:");

    //Main text area setup
    textArea = new JTextArea();
    undoManager = new UndoManager();
    wordSearcher = new WordSearcher(textArea);
    textArea.setBorder(BorderFactory.createMatteBorder(4, 4, 4, 4, Color.WHITE));
    document = textArea.getDocument();
    document.addUndoableEditListener(new UndoableEditListener() {
        @Override
        public void undoableEditHappened(UndoableEditEvent e) {
            undoManager.addEdit(e.getEdit());
        }
    });

    font = new Font("Tahoma", Font.PLAIN, 16);
    textArea.setFont(font);
    color = Color.BLUE;
    textArea.setForeground(color);

    undoManager = new UndoManager();

    fileJMenu.add(newDocumentJMenuItem);
    fileJMenu.addSeparator();
    fileJMenu.add(openJMenuItem);
    fileJMenu.add(saveJMenuItem);
    fileJMenu.addSeparator();
    fileJMenu.add(printJMenuItem);
    fileJMenu.addSeparator();
    fileJMenu.add(exitJMenuItem);

    editJMenu.add(undoJMenuItem);
    editJMenu.add(redoJMenuItem);
    editJMenu.addSeparator();
    editJMenu.add(copyJMenuItem);
    editJMenu.add(cutJMenuItem);
    editJMenu.add(pasteJMenuItem);
    editJMenu.addSeparator();
    editJMenu.add(deleteJMenuItem);
    editJMenu.add(selectAllJMenuItem);
    editJMenu.addSeparator();
    editJMenu.add(findJMenuItem);
    editJMenu.add(replaceJMenuItem);

    formatJMenu.add(wordWrapJCheckBoxMenuItem);
    formatJMenu.add(fontJMenuItem);
    formatJMenu.add(colorJMenuItem);

    viewJMenu.add(statusBarJCheckBoxMenuItem);

    helpJMenu.add(helpJMenuItem);
    helpJMenu.add(aboutJMenuItem);

    menuBar.add(fileJMenu);
    menuBar.add(editJMenu);
    menuBar.add(formatJMenu);
    menuBar.add(viewJMenu);
    menuBar.add(helpJMenu);

    southJPanel.setVisible(false);
    southJPanel.add(statusJLabel);
    //JScrollPane setup
    JScrollPane scrollPane = new JScrollPane(textArea);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    //setting uo the Jframe
    this.setJMenuBar(menuBar);
    this.add(scrollPane, BorderLayout.CENTER);
    this.add(southJPanel, BorderLayout.SOUTH);
    textArea.addMouseListener(new MouseInputListener() {

        @Override
        public void mouseClicked(MouseEvent e) {
            Highlighter h = textArea.getHighlighter();
            h.removeAllHighlights();
        }

        @Override
        public void mousePressed(MouseEvent e) {
            Highlighter h = textArea.getHighlighter();
            h.removeAllHighlights();
        }

        @Override
        public void mouseReleased(MouseEvent e) {
        }

        @Override
        public void mouseEntered(MouseEvent e) {
        }

        @Override
        public void mouseExited(MouseEvent e) {
        }

        @Override
        public void mouseDragged(MouseEvent e) {
        }

        @Override
        public void mouseMoved(MouseEvent e) {
        }
    });

    textArea.addKeyListener(new IgboKeyListener(textArea));

}

From source file:com.neurotec.samples.panels.EnrollFromScanner.java

@Override
protected void initGUI() {
    panelMain = new JPanel();
    panelScanners = new JPanel();
    scrollPaneList = new JScrollPane();
    scannerList = new JList();
    panelButtons = new JPanel();
    btnRefresh = new JButton();
    btnScan = new JButton();
    btnCancel = new JButton();
    btnForce = new JButton();
    cbAutomatic = new JCheckBox();
    scrollPane = new JScrollPane();
    panelSouth = new JPanel();
    panelInfo = new JPanel();
    lblInfo = new JLabel();
    panelSave = new JPanel();
    btnIdentifyPatient = new JButton();
    btnRegisterPatient = new JButton();
    cbShowProcessed = new JCheckBox();

    setLayout(new BorderLayout());

    panelMain.setLayout(new BorderLayout());

    panelScanners.setBorder(BorderFactory.createTitledBorder("Scanners list"));
    panelScanners.setLayout(new BorderLayout());

    scrollPaneList.setPreferredSize(new Dimension(0, 90));

    scannerList.setModel(new DefaultListModel());
    scannerList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    scannerList.setBorder(LineBorder.createBlackLineBorder());
    scrollPaneList.setViewportView(scannerList);

    panelScanners.add(scrollPaneList, BorderLayout.CENTER);

    panelButtons.setLayout(new FlowLayout(FlowLayout.LEADING));

    btnRefresh.setText("Refresh list");
    panelButtons.add(btnRefresh);/*w  ww  . java 2s.c  o  m*/

    btnScan.setText("Scan");
    panelButtons.add(btnScan);

    btnCancel.setText("Cancel");
    btnCancel.setEnabled(false);
    panelButtons.add(btnCancel);

    btnForce.setText("Force");
    panelButtons.add(btnForce);

    cbAutomatic.setSelected(true);
    cbAutomatic.setText("Scan automatically");
    panelButtons.add(cbAutomatic);

    panelScanners.add(panelButtons, BorderLayout.SOUTH);

    panelMain.add(panelScanners, BorderLayout.NORTH);
    panelMain.add(scrollPane, BorderLayout.CENTER);

    panelSouth.setLayout(new BorderLayout());

    panelInfo.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
    panelInfo.setLayout(new GridLayout(1, 1));

    lblInfo.setText(" ");
    panelInfo.add(lblInfo);

    panelSouth.add(panelInfo, BorderLayout.NORTH);

    panelSave.setLayout(new FlowLayout(FlowLayout.LEADING));

    btnIdentifyPatient.setText("Identify Patient");
    btnIdentifyPatient.setEnabled(false);
    panelSave.add(btnIdentifyPatient);

    btnRegisterPatient.setText("Register Patient");
    btnRegisterPatient.setEnabled(false);
    panelSave.add(btnRegisterPatient);

    cbShowProcessed.setSelected(true);
    cbShowProcessed.setText("Show processed image");
    panelSave.add(cbShowProcessed);

    panelSouth.add(panelSave, BorderLayout.SOUTH);

    panelMain.add(panelSouth, BorderLayout.SOUTH);

    add(panelMain, BorderLayout.CENTER);

    panelLicensing = new LicensingPanel(requiredLicenses, optionalLicenses);
    add(panelLicensing, java.awt.BorderLayout.NORTH);

    fcImage = new JFileChooser();
    fcImage.setFileFilter(new Utils.ImageFileFilter(NImages.getSaveFileFilter()));
    fcTemplate = new JFileChooser();
    view = new NFingerView();
    view.setShownImage(ShownImage.RESULT);
    view.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent ev) {
            super.mouseClicked(ev);
            if (ev.getButton() == MouseEvent.BUTTON3) {
                cbShowProcessed.doClick();
            }
        }

    });
    scrollPane.setViewportView(view);

    btnRefresh.addActionListener(this);
    btnScan.addActionListener(this);
    btnCancel.addActionListener(this);
    btnForce.addActionListener(this);
    btnIdentifyPatient.addActionListener(this);
    btnRegisterPatient.addActionListener(this);
    cbShowProcessed.addActionListener(this);
    scannerList.addListSelectionListener(new ScannerSelectionListener());
}

From source file:edu.ku.brc.specify.datamodel.busrules.CollectionObjectBusRules.java

/**
 * Show objects that were not added to the batch
 *//*from  w  w  w  . j  a va  2s. c  om*/
@SuppressWarnings("rawtypes")
protected void showBatchErrorObjects(final Vector<String> badObjects, final String TitleKey,
        final String MsgKey) {
    JPanel pane = new JPanel(new BorderLayout());
    JLabel lbl = createLabel(getResourceString(MsgKey));
    lbl.setBorder(new EmptyBorder(3, 1, 2, 0));
    pane.add(lbl, BorderLayout.NORTH);
    JPanel lstPane = new JPanel(new BorderLayout());
    JList lst = UIHelper.createList(badObjects);
    lst.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
    lstPane.setBorder(new EmptyBorder(1, 1, 10, 1));
    lstPane.add(lst, BorderLayout.CENTER);
    JScrollPane sp = new JScrollPane(lstPane);
    //pane.add(lstPane, BorderLayout.CENTER);
    pane.add(sp, BorderLayout.CENTER);
    //pane.setPreferredSize(new Dimension((int )lbl.getPreferredSize().getWidth() + 5, (int )lst.getPreferredScrollableViewportSize().getHeight() + 5));
    //pane.setPreferredSize(new Dimension((int )lbl.getPreferredSize().getWidth() + 5, (int )lst.getPreferredScrollableViewportSize().getHeight() + 5));
    CustomDialog dlg = new CustomDialog((Frame) UIRegistry.getTopWindow(),
            UIRegistry.getResourceString(TitleKey), true, CustomDialog.OKHELP, pane);
    UIHelper.centerAndShow(dlg);
    dlg.dispose();
}

From source file:edu.ku.brc.specify.tasks.subpane.wb.wbuploader.Uploader.java

public static void showStructureErrors(Vector<UploadMessage> structureErrors) {
    JPanel pane = new JPanel(new BorderLayout());
    JLabel lbl = createLabel(getResourceString("WB_UPLOAD_BAD_STRUCTURE_MSG") + ":");
    lbl.setBorder(new EmptyBorder(3, 1, 2, 0));
    pane.add(lbl, BorderLayout.NORTH);
    JPanel lstPane = new JPanel(new BorderLayout());
    JList<?> lst = UIHelper.createList(structureErrors);
    lst.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
    lstPane.setBorder(new EmptyBorder(1, 1, 10, 1));
    lstPane.add(lst, BorderLayout.CENTER);
    pane.add(lstPane, BorderLayout.CENTER);
    CustomDialog dlg = new CustomDialog((Frame) UIRegistry.getTopWindow(),
            getResourceString("WB_UPLOAD_BAD_STRUCTURE_DLG"), true, CustomDialog.OKHELP, pane);
    UIHelper.centerAndShow(dlg);//from  w  w  w.  ja  v a2 s  .  co m
    dlg.dispose();
}

From source file:op.care.info.DlgDiag.java

/**
 * This method is called from within the constructor to
 * initialize the form./*from ww  w .  j a  v  a2  s  . co  m*/
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the PrinterForm Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    jPanel1 = new JPanel();
    txtSuche = new JXSearchField();
    lblTX = new JLabel();
    jspDiagnosen = new JScrollPane();
    lstDiag = new JList();
    lblDiagBy = new JLabel();
    cmbArzt = new JComboBox<>();
    btnAddGP = new JButton();
    cmbKH = new JComboBox<>();
    btnAddHospital = new JButton();
    lblSecurity = new JLabel();
    lblSide = new JLabel();
    cmbKoerper = new JComboBox<>();
    cmbSicherheit = new JComboBox<>();
    jScrollPane1 = new JScrollPane();
    txtBemerkung = new JTextArea();
    lblInterval = new JLabel();
    panel1 = new JPanel();
    btnCancel = new JButton();
    btnOK = new JButton();

    //======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== jPanel1 ========
    {
        jPanel1.setBorder(new SoftBevelBorder(SoftBevelBorder.RAISED));
        jPanel1.setLayout(new FormLayout(
                "default, $lcgap, pref, $lcgap, default:grow, $ugap, pref, $lcgap, default:grow, 2*($lcgap, default)",
                "default, $lgap, fill:default, $lgap, fill:104dlu:grow, $lgap, fill:default, $lgap, default, $lgap, fill:default, $lgap, fill:89dlu:grow, $ugap, default, $lgap, default"));

        //---- txtSuche ----
        txtSuche.setFont(new Font("Arial", Font.PLAIN, 14));
        txtSuche.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                txtSucheActionPerformed(e);
            }
        });
        jPanel1.add(txtSuche, CC.xywh(3, 3, 7, 1));

        //---- lblTX ----
        lblTX.setText(null);
        lblTX.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/ambulance2.png")));
        jPanel1.add(lblTX, CC.xy(11, 3));

        //======== jspDiagnosen ========
        {

            //---- lstDiag ----
            lstDiag.setFont(new Font("Arial", Font.PLAIN, 14));
            jspDiagnosen.setViewportView(lstDiag);
        }
        jPanel1.add(jspDiagnosen, CC.xywh(3, 5, 9, 1));

        //---- lblDiagBy ----
        lblDiagBy.setText("Festgestellt durch:");
        lblDiagBy.setFont(new Font("Arial", Font.PLAIN, 14));
        jPanel1.add(lblDiagBy, CC.xy(3, 7, CC.RIGHT, CC.DEFAULT));

        //---- cmbArzt ----
        cmbArzt.setModel(new DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cmbArzt.setFont(new Font("Arial", Font.PLAIN, 14));
        jPanel1.add(cmbArzt, CC.xywh(5, 7, 5, 1));

        //---- btnAddGP ----
        btnAddGP.setText(null);
        btnAddGP.setBorder(null);
        btnAddGP.setContentAreaFilled(false);
        btnAddGP.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/add.png")));
        btnAddGP.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        btnAddGP.setSelectedIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/pressed.png")));
        btnAddGP.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                btnAddGPActionPerformed(e);
            }
        });
        jPanel1.add(btnAddGP, CC.xy(11, 7));

        //---- cmbKH ----
        cmbKH.setModel(new DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cmbKH.setFont(new Font("Arial", Font.PLAIN, 14));
        jPanel1.add(cmbKH, CC.xywh(5, 9, 5, 1));

        //---- btnAddHospital ----
        btnAddHospital.setText(null);
        btnAddHospital.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/add.png")));
        btnAddHospital.setBorder(null);
        btnAddHospital.setContentAreaFilled(false);
        btnAddHospital.setBorderPainted(false);
        btnAddHospital.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        btnAddHospital.setSelectedIcon(new ImageIcon(getClass().getResource("/artwork/22x22/bw/pressed.png")));
        btnAddHospital.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                btnAddHospitalActionPerformed(e);
            }
        });
        jPanel1.add(btnAddHospital, CC.xy(11, 9));

        //---- lblSecurity ----
        lblSecurity.setText("Diagnosesicherheit:");
        lblSecurity.setFont(new Font("Arial", Font.PLAIN, 14));
        jPanel1.add(lblSecurity, CC.xy(7, 11));

        //---- lblSide ----
        lblSide.setText("K\u00f6rperseite:");
        lblSide.setFont(new Font("Arial", Font.PLAIN, 14));
        jPanel1.add(lblSide, CC.xy(3, 11, CC.RIGHT, CC.DEFAULT));

        //---- cmbKoerper ----
        cmbKoerper.setModel(new DefaultComboBoxModel<>(
                new String[] { "Nicht festgelegt", "links", "rechts", "beidseitig" }));
        cmbKoerper.setFont(new Font("Arial", Font.PLAIN, 14));
        jPanel1.add(cmbKoerper, CC.xy(5, 11));

        //---- cmbSicherheit ----
        cmbSicherheit.setModel(new DefaultComboBoxModel<>(new String[] { "Nicht festgelegt", "gesichert",
                "Verdacht auf", "Ausschlu\u00df von", "Zustand nach" }));
        cmbSicherheit.setFont(new Font("Arial", Font.PLAIN, 14));
        jPanel1.add(cmbSicherheit, CC.xywh(9, 11, 3, 1));

        //======== jScrollPane1 ========
        {

            //---- txtBemerkung ----
            txtBemerkung.setColumns(20);
            txtBemerkung.setRows(5);
            txtBemerkung.setFont(new Font("Arial", Font.PLAIN, 14));
            jScrollPane1.setViewportView(txtBemerkung);
        }
        jPanel1.add(jScrollPane1, CC.xywh(3, 13, 9, 1));

        //---- lblInterval ----
        lblInterval.setText("text");
        jPanel1.add(lblInterval, CC.xywh(3, 15, 5, 1));

        //======== panel1 ========
        {
            panel1.setLayout(new HorizontalLayout(5));

            //---- btnCancel ----
            btnCancel.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/cancel.png")));
            btnCancel.setText(null);
            btnCancel.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    btnCancelActionPerformed(e);
                }
            });
            panel1.add(btnCancel);

            //---- btnOK ----
            btnOK.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png")));
            btnOK.setText(null);
            btnOK.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    btnOKActionPerformed(e);
                }
            });
            panel1.add(btnOK);
        }
        jPanel1.add(panel1, CC.xywh(7, 15, 5, 1, CC.RIGHT, CC.DEFAULT));
    }
    contentPane.add(jPanel1, BorderLayout.CENTER);
    setSize(730, 565);
    setLocationRelativeTo(getOwner());
}

From source file:op.FrmMain.java

/**
 * This method is called from within the constructor to
 * initialize the form.//from w  w w.  ja va 2 s.  c om
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the PrinterForm Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    pnlMain = new JPanel();
    pnlMainMessage = new JPanel();
    btnTX = new JButton();
    panel1 = new JPanel();
    pnlIcons = new JPanel();
    lblMainMsg = new JLabel();
    btnExit = new JButton();
    lblSubMsg = new JideLabel();
    btnHelp = new JButton();
    pbMsg = new JProgressBar();
    btnReload = new JButton();
    splitPaneLeft = new JideSplitPane();
    pnlCard = new JPanel();
    pnlWait = new JPanel();
    lblWait = new JLabel();
    pbTimeout = new JProgressBar();
    panel2 = new JPanel();
    btnResetSplitpane = new JButton();
    statusBar = new StatusBar();

    //======== this ========
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Offene-Pflege.de");
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            thisWindowClosing(e);
        }
    });
    Container contentPane = getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS));

    //======== pnlMain ========
    {
        pnlMain.setLayout(new FormLayout("0dlu, $lcgap, pref, $lcgap, left:default:grow, 2*($rgap)",
                "$rgap, pref, $rgap, default:grow, 3dlu, $nlgap, bottom:pref, $lgap, 0dlu"));

        //======== pnlMainMessage ========
        {
            pnlMainMessage.setBackground(new Color(220, 223, 208));
            pnlMainMessage.setBorder(new SoftBevelBorder(SoftBevelBorder.RAISED));
            pnlMainMessage.setLayout(new FormLayout(
                    "0dlu, $lcgap, 23dlu, $lcgap, default:grow, $lcgap, min, $lcgap, 0dlu",
                    "0dlu, $lgap, 15dlu, $lgap, fill:11dlu, $lgap, fill:pref:grow, $lgap, pref, $lgap, 0dlu"));

            //---- btnTX ----
            btnTX.setIcon(new ImageIcon(getClass().getResource("/artwork/32x32/ambulance2.png")));
            btnTX.setBorder(null);
            btnTX.setBorderPainted(false);
            btnTX.setSelectedIcon(null);
            btnTX.setToolTipText("Verlegungsbericht drucken");
            btnTX.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnTX.setPressedIcon(
                    new ImageIcon(getClass().getResource("/artwork/32x32/ambulance2_pressed.png")));
            btnTX.setContentAreaFilled(false);
            btnTX.addActionListener(e -> btnTXActionPerformed(e));
            pnlMainMessage.add(btnTX, CC.xywh(3, 3, 1, 3));

            //======== panel1 ========
            {
                panel1.setOpaque(false);
                panel1.setLayout(new BoxLayout(panel1, BoxLayout.LINE_AXIS));

                //======== pnlIcons ========
                {
                    pnlIcons.setOpaque(false);
                    pnlIcons.setLayout(new BoxLayout(pnlIcons, BoxLayout.LINE_AXIS));
                }
                panel1.add(pnlIcons);

                //---- lblMainMsg ----
                lblMainMsg.setText("OPDE");
                lblMainMsg.setFont(new Font("Arial Rounded MT Bold", Font.PLAIN, 22));
                lblMainMsg.setForeground(new Color(105, 80, 69));
                lblMainMsg.setHorizontalAlignment(SwingConstants.CENTER);
                lblMainMsg.setIcon(null);
                lblMainMsg.setHorizontalTextPosition(SwingConstants.LEADING);
                panel1.add(lblMainMsg);
            }
            pnlMainMessage.add(panel1, CC.xy(5, 3, CC.CENTER, CC.DEFAULT));

            //---- btnExit ----
            btnExit.setIcon(new ImageIcon(getClass().getResource("/artwork/32x32/lock.png")));
            btnExit.setBorder(null);
            btnExit.setBorderPainted(false);
            btnExit.setOpaque(false);
            btnExit.setContentAreaFilled(false);
            btnExit.setToolTipText("Abmelden");
            btnExit.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnExit.setPressedIcon(new ImageIcon(getClass().getResource("/artwork/32x32/lock_pressed.png")));
            btnExit.addActionListener(e -> btnExitActionPerformed(e));
            pnlMainMessage.add(btnExit, CC.xywh(7, 3, 1, 3));

            //---- lblSubMsg ----
            lblSubMsg.setText("OPDE");
            lblSubMsg.setFont(new Font("Arial", Font.PLAIN, 14));
            lblSubMsg.setForeground(new Color(105, 80, 69));
            lblSubMsg.setHorizontalAlignment(SwingConstants.CENTER);
            lblSubMsg.setVerticalAlignment(SwingConstants.TOP);
            pnlMainMessage.add(lblSubMsg, CC.xywh(5, 5, 1, 3));

            //---- btnHelp ----
            btnHelp.setText(null);
            btnHelp.setIcon(new ImageIcon(getClass().getResource("/artwork/32x32/help.png")));
            btnHelp.setBorderPainted(false);
            btnHelp.setContentAreaFilled(false);
            btnHelp.setPressedIcon(new ImageIcon(getClass().getResource("/artwork/32x32/help_pressed.png")));
            btnHelp.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnHelp.addActionListener(e -> btnHelpActionPerformed(e));
            pnlMainMessage.add(btnHelp, CC.xywh(3, 7, 1, 3));

            //---- pbMsg ----
            pbMsg.setValue(50);
            pbMsg.setFont(new Font("Arial Rounded MT Bold", Font.PLAIN, 12));
            pbMsg.setForeground(new Color(105, 80, 69));
            pnlMainMessage.add(pbMsg, CC.xy(5, 9, CC.FILL, CC.FILL));

            //---- btnReload ----
            btnReload.setIcon(new ImageIcon(getClass().getResource("/artwork/32x32/reload0000.png")));
            btnReload.setBorder(null);
            btnReload.setBorderPainted(false);
            btnReload.setOpaque(false);
            btnReload.setContentAreaFilled(false);
            btnReload.setToolTipText("Ansicht aktualisieren");
            btnReload.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
            btnReload
                    .setPressedIcon(new ImageIcon(getClass().getResource("/artwork/32x32/reload_pressed.png")));
            btnReload.addActionListener(e -> btnReloadActionPerformed(e));
            pnlMainMessage.add(btnReload, CC.xywh(7, 7, 1, 3));
        }
        pnlMain.add(pnlMainMessage, CC.xywh(3, 2, 4, 1, CC.DEFAULT, CC.FILL));

        //---- splitPaneLeft ----
        splitPaneLeft.setOneTouchExpandable(true);
        splitPaneLeft.setProportionalLayout(true);
        splitPaneLeft.setShowGripper(true);
        splitPaneLeft.addPropertyChangeListener("dividerLocation", e -> splitPaneLeftPropertyChange(e));
        pnlMain.add(splitPaneLeft, CC.xy(3, 4, CC.FILL, CC.FILL));

        //======== pnlCard ========
        {
            pnlCard.setLayout(new CardLayout());

            //======== pnlWait ========
            {
                pnlWait.setLayout(new BorderLayout());

                //---- lblWait ----
                lblWait.setText("text");
                lblWait.setFont(new Font("Arial", Font.BOLD, 22));
                lblWait.setHorizontalAlignment(SwingConstants.CENTER);
                pnlWait.add(lblWait, BorderLayout.CENTER);
            }
            pnlCard.add(pnlWait, "cardWait");
        }
        pnlMain.add(pnlCard, CC.xy(5, 4, CC.FILL, CC.FILL));
        pnlMain.add(pbTimeout, CC.xywh(3, 5, 4, 1, CC.FILL, CC.DEFAULT));

        //======== panel2 ========
        {
            panel2.setLayout(new BoxLayout(panel2, BoxLayout.X_AXIS));

            //---- btnResetSplitpane ----
            btnResetSplitpane.setText(null);
            btnResetSplitpane
                    .setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/view_top_bottom.png")));
            btnResetSplitpane.setAlignmentY(1.0F);
            btnResetSplitpane.addActionListener(e -> btnResetSplitpaneActionPerformed(e));
            panel2.add(btnResetSplitpane);

            //---- statusBar ----
            statusBar.setBackground(new Color(238, 238, 238));
            statusBar.setAlignmentY(1.0F);
            panel2.add(statusBar);
        }
        pnlMain.add(panel2, CC.xywh(3, 7, 4, 1, CC.FILL, CC.BOTTOM));
    }
    contentPane.add(pnlMain);
    setSize(945, 695);
    setLocationRelativeTo(getOwner());
}

From source file:org.openmrs.module.muzimabiometrics.panels.EnrollFromScanner.java

@Override
protected void initGUI() {
    panelMain = new JPanel();
    panelScanners = new JPanel();
    scrollPaneList = new JScrollPane();
    scannerList = new JList();
    panelButtons = new JPanel();
    btnRefresh = new JButton();
    btnScan = new JButton();
    btnCancel = new JButton();
    btnForce = new JButton();
    cbAutomatic = new JCheckBox();
    scrollPane = new JScrollPane();
    panelSouth = new JPanel();
    panelInfo = new JPanel();
    lblInfo = new JLabel();
    panelSave = new JPanel();
    btnIdentifyPatient = new JButton();
    btnRegisterPatient = new JButton();
    cbShowProcessed = new JCheckBox();

    setLayout(new BorderLayout());

    panelMain.setLayout(new BorderLayout());

    panelScanners.setBorder(BorderFactory.createTitledBorder("Scanners list"));
    panelScanners.setLayout(new BorderLayout());

    scrollPaneList.setPreferredSize(new Dimension(0, 90));

    scannerList.setModel(new DefaultListModel());
    scannerList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    scannerList.setBorder(LineBorder.createBlackLineBorder());
    scrollPaneList.setViewportView(scannerList);

    panelScanners.add(scrollPaneList, BorderLayout.CENTER);

    panelButtons.setLayout(new FlowLayout(FlowLayout.LEADING));

    btnRefresh.setText("Refresh list");
    panelButtons.add(btnRefresh);//  www  .j  a  v  a 2  s. c om

    btnScan.setText("Scan");
    panelButtons.add(btnScan);

    btnCancel.setText("Cancel");
    btnCancel.setEnabled(false);
    panelButtons.add(btnCancel);

    btnForce.setText("Force");
    panelButtons.add(btnForce);

    cbAutomatic.setSelected(true);
    cbAutomatic.setText("Scan automatically");
    panelButtons.add(cbAutomatic);

    panelScanners.add(panelButtons, BorderLayout.SOUTH);

    panelMain.add(panelScanners, BorderLayout.NORTH);
    panelMain.add(scrollPane, BorderLayout.CENTER);

    panelSouth.setLayout(new BorderLayout());

    panelInfo.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));
    panelInfo.setLayout(new GridLayout(1, 1));

    lblInfo.setText(" ");
    panelInfo.add(lblInfo);

    panelSouth.add(panelInfo, BorderLayout.NORTH);

    panelSave.setLayout(new FlowLayout(FlowLayout.LEADING));

    btnIdentifyPatient.setText("Scan fingerprint");
    btnIdentifyPatient.setEnabled(true);
    panelSave.add(btnIdentifyPatient);

    btnRegisterPatient.setText("Register Patient");
    btnRegisterPatient.setEnabled(true);
    panelSave.add(btnRegisterPatient);

    cbShowProcessed.setSelected(true);
    cbShowProcessed.setText("Show processed image");
    panelSave.add(cbShowProcessed);

    panelSouth.add(panelSave, BorderLayout.SOUTH);

    panelMain.add(panelSouth, BorderLayout.SOUTH);

    add(panelMain, BorderLayout.CENTER);

    panelLicensing = new LicensingPanel(requiredLicenses, optionalLicenses);
    add(panelLicensing, java.awt.BorderLayout.NORTH);

    fcImage = new JFileChooser();
    fcImage.setFileFilter(new Utils.ImageFileFilter(NImages.getSaveFileFilter()));
    fcTemplate = new JFileChooser();
    view = new NFingerView();
    view.setShownImage(ShownImage.RESULT);
    view.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent ev) {
            super.mouseClicked(ev);
            if (ev.getButton() == MouseEvent.BUTTON3) {
                cbShowProcessed.doClick();
            }
        }

    });
    scrollPane.setViewportView(view);

    btnRefresh.addActionListener(this);
    btnScan.addActionListener(this);
    btnCancel.addActionListener(this);
    btnForce.addActionListener(this);
    btnIdentifyPatient.addActionListener(this);
    btnRegisterPatient.addActionListener(this);
    cbShowProcessed.addActionListener(this);
    scannerList.addListSelectionListener(new ScannerSelectionListener());
}