Example usage for javax.swing BorderFactory createLoweredBevelBorder

List of usage examples for javax.swing BorderFactory createLoweredBevelBorder

Introduction

In this page you can find the example usage for javax.swing BorderFactory createLoweredBevelBorder.

Prototype

public static Border createLoweredBevelBorder() 

Source Link

Document

Creates a border with a lowered beveled edge, using brighter shades of the component's current background color for highlighting, and darker shading for shadows.

Usage

From source file:DiningPhilosophers.java

public void init() {

    imgs[HUNGRYDUKE] = new ImageIcon(getURL("images/hungryduke.gif"));
    imgs[RIGHTSPOONDUKE] = new ImageIcon(getURL("images/rightspoonduke.gif"));
    imgs[BOTHSPOONSDUKE] = new ImageIcon(getURL("images/bothspoonsduke.gif"));

    width = imgs[HUNGRYDUKE].getIconWidth() + (int) (MARGIN * 2.0);
    height = imgs[HUNGRYDUKE].getIconHeight() + (int) (MARGIN * 2.0);
    spacing = width + MARGIN;/*w ww. jav a  2 s .  c  o m*/

    GridBagLayout gridBag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();

    JPanel contentPane = new JPanel();
    contentPane.setLayout(gridBag);

    philosopherArea = new JPanel(null);
    philosopherArea.setBackground(Color.white);
    Dimension preferredSize = createPhilosophersAndChopsticks();
    philosopherArea.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLoweredBevelBorder(),
            BorderFactory.createEmptyBorder(5, 5, 5, 5)));
    philosopherArea.setPreferredSize(preferredSize);

    c.fill = GridBagConstraints.BOTH;
    c.weighty = 1.0;
    c.gridwidth = GridBagConstraints.REMAINDER; //end row
    gridBag.setConstraints(philosopherArea, c);
    contentPane.add(philosopherArea);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1.0;
    c.weighty = 0.0;
    gridBag.setConstraints(stopStartButton, c);
    contentPane.add(stopStartButton);

    c.gridwidth = GridBagConstraints.RELATIVE; //don't end row
    c.weightx = 1.0;
    c.weighty = 0.0;
    gridBag.setConstraints(grabDelaySlider, c);
    contentPane.add(grabDelaySlider);

    c.weightx = 0.0;
    c.gridwidth = GridBagConstraints.REMAINDER; //end row
    gridBag.setConstraints(label, c);
    contentPane.add(label);
    contentPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);

    stopStartButton.addActionListener(this);
    grabDelaySlider.addChangeListener(this);

}

From source file:IconDemoApplet.java

public void init() {
    //Parse the applet parameters
    pictures = parseParameters();/*from  w  w  w. j a va 2 s .  c  o m*/

    //If the applet tag doesn't provide an "IMAGE0" parameter,
    //display an error message.
    if (pictures.size() == 0) {
        captionLabel = new JLabel("No images listed in applet tag.");
        captionLabel.setHorizontalAlignment(JLabel.CENTER);
        getContentPane().add(captionLabel);
        return;
    }

    //NOW CREATE THE GUI COMPONENTS

    //A label to identify XX of XX.
    numberLabel = new JLabel("Picture " + (current + 1) + " of " + pictures.size());
    numberLabel.setHorizontalAlignment(JLabel.LEFT);
    numberLabel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 5));

    //A label for the caption.
    final Photo first = (Photo) pictures.firstElement();
    captionLabel = new JLabel(first.caption);
    captionLabel.setHorizontalAlignment(JLabel.CENTER);
    captionLabel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));

    //A label for displaying the photographs.
    photographLabel = new JLabel("Loading first image...");
    photographLabel.setHorizontalAlignment(JLabel.CENTER);
    photographLabel.setVerticalAlignment(JLabel.CENTER);
    photographLabel.setVerticalTextPosition(JLabel.CENTER);
    photographLabel.setHorizontalTextPosition(JLabel.CENTER);
    photographLabel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLoweredBevelBorder(),
            BorderFactory.createEmptyBorder(5, 5, 5, 5)));
    photographLabel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0),
            photographLabel.getBorder()));

    //Set the preferred size for the picture,
    //with room for the borders.
    Insets i = photographLabel.getInsets();
    photographLabel.setPreferredSize(
            new Dimension(widthOfWidest + i.left + i.right, heightOfTallest + i.bottom + i.top));

    //Create the next and previous buttons.
    ImageIcon nextIcon = new ImageIcon(getURL(imagedir + "right.gif"));
    ImageIcon dimmedNextIcon = new ImageIcon(getURL(imagedir + "dimmedRight.gif"));
    ImageIcon previousIcon = new ImageIcon(getURL(imagedir + "left.gif"));
    ImageIcon dimmedPreviousIcon = new ImageIcon(getURL(imagedir + "dimmedLeft.gif"));

    previousButton = new JButton("Previous Picture", previousIcon);
    previousButton.setDisabledIcon(dimmedPreviousIcon);
    previousButton.setVerticalTextPosition(AbstractButton.CENTER);
    previousButton.setHorizontalTextPosition(AbstractButton.RIGHT);
    previousButton.setMnemonic(KeyEvent.VK_P);
    previousButton.setActionCommand("previous");
    previousButton.addActionListener(this);
    previousButton.setEnabled(false);

    nextButton = new JButton("Next Picture", nextIcon);
    nextButton.setDisabledIcon(dimmedNextIcon);
    nextButton.setVerticalTextPosition(AbstractButton.CENTER);
    nextButton.setHorizontalTextPosition(AbstractButton.LEFT);
    nextButton.setMnemonic(KeyEvent.VK_N);
    nextButton.setActionCommand("next");
    nextButton.addActionListener(this);

    //Lay out the GUI.
    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();

    Container contentPane = getContentPane();
    contentPane.setLayout(layout);

    c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.HORIZONTAL;
    layout.setConstraints(numberLabel, c);
    contentPane.add(numberLabel);

    layout.setConstraints(captionLabel, c);
    contentPane.add(captionLabel);

    c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.BOTH;
    layout.setConstraints(photographLabel, c);
    contentPane.add(photographLabel);

    c.gridwidth = GridBagConstraints.RELATIVE;
    c.fill = GridBagConstraints.HORIZONTAL;
    layout.setConstraints(previousButton, c);
    contentPane.add(previousButton);

    c.gridwidth = GridBagConstraints.REMAINDER;
    layout.setConstraints(nextButton, c);
    contentPane.add(nextButton);

    //Start loading the image for the first photograph now.
    //The loadImage method uses a SwingWorker
    //to load the image in a separate thread.
    loadImage(imagedir + first.filename, current);
}

From source file:gui.TwopointPWDPanel.java

private JPanel createControls() {
    // Marker model (for ordered list of markers)
    markerModel = new PWDTableModel();

    // Populate the marker table
    markerTable = new JTable(markerModel);
    markerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    markerTable.getColumnModel().getColumn(1).setPreferredWidth(175);
    markerTable.getColumnModel().getColumn(2).setPreferredWidth(60);
    for (CMarker cm : order.getLinkageGroup().getMarkers()) {
        markerModel.addRow(new Object[] { cm.marker.getPrefix(), cm, cm.marker.getRatio() });
    }//from  w w w  . j  a  v  a2s  .  c o  m
    markerTable.getSelectionModel().addListSelectionListener(this);

    // Phase model (for scores of each ordered marker against the others)
    phaseModel = new PWDTableModel2();
    phaseModel.setColumnIdentifiers(new Object[] { "Graph Code", "Marker Name", "Recom Freq", "LOD Score" });

    phaseTable = new JTable(phaseModel);
    phaseTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    phaseTable.getSelectionModel().addListSelectionListener(this);

    rfqChart = new PWDChartPanel("Recombination Freq");
    lodChart = new PWDChartPanel("LOD Score");

    m1Label = new JLabel("");
    m1Label.setFont(new Font("Monospaced", Font.PLAIN, 11));
    m2Label = new JLabel("");
    m2Label.setFont(new Font("Monospaced", Font.PLAIN, 11));

    JScrollPane mSP = new JScrollPane(markerTable);
    mSP.setPreferredSize(new Dimension(300, 10));

    JPanel p1 = new JPanel(new BorderLayout(5, 0));
    p1.add(new JLabel("Ordered Markers:"), BorderLayout.NORTH);
    p1.add(mSP);

    JPanel p2 = new JPanel(new BorderLayout(5, 0));
    p2.add(new JLabel("Scores:"), BorderLayout.NORTH);
    p2.add(new JScrollPane(phaseTable));

    JPanel p3 = new JPanel(new GridLayout(2, 1, 2, 2));
    p3.setBorder(BorderFactory.createLoweredBevelBorder());
    p3.add(m1Label);
    p3.add(m2Label);

    JPanel p4 = new JPanel(new GridLayout(1, 2, 5, 5));
    p4.add(rfqChart);
    p4.add(lodChart);

    JPanel p5 = new JPanel(new BorderLayout(5, 5));
    p5.add(p3, BorderLayout.NORTH);
    p5.add(p4, BorderLayout.CENTER);

    JSplitPane splits = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splits.setResizeWeight(0.5);
    splits.setLeftComponent(p1);
    splits.setRightComponent(p2);

    JPanel p6 = new JPanel(new BorderLayout(5, 5));
    p6.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    p6.add(splits);
    p6.add(p5, BorderLayout.SOUTH);

    return p6;
}

From source file:edu.ku.brc.af.ui.PasswordStrengthUI.java

/**
 * Constructor.//w w  w  . j  a  v a2 s  . co m
 */
public PasswordStrengthUI(final int minPwdLen) {
    super(new BorderLayout());

    this.minPwdLen = minPwdLen;

    progress = new JProgressBar(0, 100);
    //add(progress, BorderLayout.CENTER);

    UIRegistry.loadAndPushResourceBundle("specify_plugins");
    scoreStrings = new String[SCORE_KEYS.length];
    for (int i = 0; i < SCORE_KEYS.length; i++) {
        scoreStrings[i] = UIRegistry.getResourceString(getKey(SCORE_KEYS[i]));
    }

    CellConstraints cc = new CellConstraints();
    PanelBuilder pbi = new PanelBuilder(
            new FormLayout(UIHelper.createDuplicateJGoodiesDef("p", "4px", cbxs.length), "p"));
    errorStrings = new String[ERR_KEYS.length];
    int x = 1;
    for (int i = 0; i < ERR_KEYS.length; i++) {
        errorStrings[i] = UIRegistry.getResourceString(getKey(ERR_KEYS[i]));
        cbxs[i] = UIHelper.createCheckBox(errorStrings[i]);
        pbi.add(cbxs[i], cc.xy(x, 1));
        cbxs[i].setEnabled(false);
        x += 2;
    }
    UIRegistry.popResourceBundle();

    colorPanel = new ColorPanel();
    colorPanel.setBorder(BorderFactory.createLoweredBevelBorder());

    PanelBuilder pb = new PanelBuilder(new FormLayout("f:p:g", "p,4px,p"), this);
    pb.add(colorPanel, cc.xy(1, 1));
    pb.add(pbi.getPanel(), cc.xy(1, 3));
}

From source file:org.lmn.fc.frameworks.starbase.plugins.observatory.ui.tabs.fft.impl.AveragingFFTCanvas.java

/***********************************************************************************************
 * Initialise this UIComponent.//from   w w  w .  j a  v  a2 s  . c  om
 */

public void initialiseUI() {
    final Border compoundBorder;

    super.initialiseUI();
    removeAll();

    setBackground(getBackgroundColour().getColor());
    setOpaque(true);

    // Make sure that the Canvas uses all available space...
    setPreferredSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));

    // Add a Border to the Canvas panel
    compoundBorder = BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(),
            BorderFactory.createLoweredBevelBorder());
    setBorder(compoundBorder);

    // There is only ever one Chart, a special version with no Toolbar
    setChartViewer(new LogLinChartUIComponent(getHostFrameUI().getHostTask(), getHostInstrument(), "FFT", null,
            REGISTRY.getFrameworkResourceKey(), DataUpdateType.PRESERVE,
            REGISTRY.getIntegerProperty(
                    getHostInstrument().getHostAtom().getResourceKey() + KEY_DISPLAY_DATA_MAX),
            -1000.0, 1000.0, -1000.0, 1000.0) {
        final static long serialVersionUID = -2433194350569140263L;

        /**********************************************************************************
         * Customise the XYPlot of a new chart, e.g. for fixed range axes.
         *
         * @param datasettype
         * @param primarydataset
         * @param secondarydatasets
         * @param updatetype
         * @param displaylimit
         * @param channelselector
         * @param debug
         *
         * @return JFreeChart
         */

        public JFreeChart createCustomisedChart(final DatasetType datasettype, final XYDataset primarydataset,
                final List<XYDataset> secondarydatasets, final DataUpdateType updatetype,
                final int displaylimit, final ChannelSelectorUIComponentInterface channelselector,
                final boolean debug) {
            final JFreeChart jFreeChart;

            jFreeChart = super.createCustomisedChart(datasettype, primarydataset, secondarydatasets, updatetype,
                    displaylimit, channelselector, debug);
            // Remove all labels
            jFreeChart.setTitle(EMPTY_STRING);

            if ((jFreeChart.getXYPlot() != null) && (jFreeChart.getXYPlot().getDomainAxis() != null)) {
                jFreeChart.getXYPlot().getDomainAxis().setLabel(EMPTY_STRING);
            }

            if ((jFreeChart.getXYPlot() != null) && (jFreeChart.getXYPlot().getRangeAxis() != null)) {
                jFreeChart.getXYPlot().getRangeAxis().setLabel(EMPTY_STRING);
            }

            return (jFreeChart);
        }

        /**********************************************************************************
         * Initialise the Chart.
         */

        public synchronized void initialiseUI() {
            final String SOURCE = "ChartUIComponent.initialiseUI() ";

            setChannelSelector(false);
            setDatasetDomainControl(false);

            super.initialiseUI();

            // Indicate if the Chart can Autorange, and is currently Autoranging
            setCanAutorange(true);
            setLinearMode(true);

            // Configure the Chart for this specific use
            if (getChannelSelectorOccupant() != null) {
                getChannelSelectorOccupant().setAutoranging(true);
                getChannelSelectorOccupant().setLinearMode(true);
                getChannelSelectorOccupant().setDecimating(false);
                getChannelSelectorOccupant().setLegend(false);
                getChannelSelectorOccupant().setShowChannels(false);
                getChannelSelectorOccupant().debugSelector(LOADER_PROPERTIES.isChartDebug(), SOURCE);
            }
        }
    });

    getChartViewer().initialiseUI();

    add((Component) getChartViewer(), BorderLayout.CENTER);
}

From source file:gui.TwopointPWDPanelnonsnp.java

private JPanel createControls() {
    // Marker model (for ordered list of markers)
    markerModel = new PWDTableModel();

    // Populate the marker table
    markerTable = new JTable(markerModel);
    markerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    markerTable.getColumnModel().getColumn(0).setPreferredWidth(60);
    markerTable.getColumnModel().getColumn(1).setPreferredWidth(130);
    markerTable.getColumnModel().getColumn(2).setPreferredWidth(50);// ratio
    markerTable.getColumnModel().getColumn(3).setPreferredWidth(70);// geno
    markerTable.getColumnModel().getColumn(4).setPreferredWidth(50);// p1
    markerTable.getColumnModel().getColumn(5).setPreferredWidth(50);// p2
    for (CMarker cm : order.getLinkageGroup().getMarkers()) {
        markerModel.addRow(new Object[] { cm.marker.getPrefix(), cm, cm.marker.getRatio(),
                cm.marker.getRatioGenotypes(), "0000", "0000" });
    }//from w w w . ja  v a2 s .c  om
    markerTable.getSelectionModel().addListSelectionListener(this);

    if (order.rows != null) {
        int row = 0;
        for (String[] data : order.rows) {
            for (int i = 0; i < 2; i++) {
                markerModel.setValueAt(data[i], row, i + 4);
            }
            row++;
        }
    } else {
        order.rows = getSelection();
    }

    // Phase model (for scores of each ordered marker against the others)
    phaseModel = new PWDTableModel2();
    phaseModel.setColumnIdentifiers(new Object[] { "Graph Code", "Marker Name", "Recom Freq", "LOD Score" });

    phaseTable = new JTable(phaseModel);
    phaseTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    phaseTable.getSelectionModel().addListSelectionListener(this);

    rfqChart = new PWDChartPanel("Recombination Freq");
    lodChart = new PWDChartPanel("LOD Score");

    m1Label = new JLabel("");
    m1Label.setFont(new Font("Monospaced", Font.PLAIN, 11));
    m2Label = new JLabel("");
    m2Label.setFont(new Font("Monospaced", Font.PLAIN, 11));

    JScrollPane mSP = new JScrollPane(markerTable);
    mSP.setPreferredSize(new Dimension(300, 10));

    JPanel p1 = new JPanel(new BorderLayout(5, 0));
    p1.add(new JLabel("Ordered Markers:"), BorderLayout.NORTH);
    p1.add(mSP);

    JPanel p2 = new JPanel(new BorderLayout(5, 0));
    p2.add(new JLabel("Scores:"), BorderLayout.NORTH);
    p2.add(new JScrollPane(phaseTable));

    JPanel p3 = new JPanel(new GridLayout(2, 1, 2, 2));
    p3.setBorder(BorderFactory.createLoweredBevelBorder());
    p3.add(m1Label);
    p3.add(m2Label);

    JPanel p4 = new JPanel(new GridLayout(1, 2, 5, 5));
    p4.add(rfqChart);
    p4.add(lodChart);

    JPanel p5 = new JPanel(new BorderLayout(5, 5));
    p5.add(p3, BorderLayout.NORTH);
    p5.add(p4, BorderLayout.CENTER);

    JSplitPane splits = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splits.setResizeWeight(0.5);
    splits.setLeftComponent(p1);
    splits.setRightComponent(p2);

    JPanel p6 = new JPanel(new BorderLayout(5, 5));
    p6.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    p6.add(splits);
    p6.add(p5, BorderLayout.SOUTH);

    return p6;
}

From source file:FillViewportHeightDemo.java

public FillViewportHeightDemo() {
    super("Empty Table DnD Demo");

    tableModel = getDefaultTableModel();
    table = new JTable(tableModel);
    table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    table.setDropMode(DropMode.INSERT_ROWS);

    table.setTransferHandler(new TransferHandler() {

        public boolean canImport(TransferSupport support) {
            // for the demo, we'll only support drops (not clipboard paste)
            if (!support.isDrop()) {
                return false;
            }/*from  w w w  . j a  va 2s. c  o  m*/

            // we only import Strings
            if (!support.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                return false;
            }

            return true;
        }

        public boolean importData(TransferSupport support) {
            // if we can't handle the import, say so
            if (!canImport(support)) {
                return false;
            }

            // fetch the drop location
            JTable.DropLocation dl = (JTable.DropLocation) support.getDropLocation();

            int row = dl.getRow();

            // fetch the data and bail if this fails
            String data;
            try {
                data = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
            } catch (UnsupportedFlavorException e) {
                return false;
            } catch (IOException e) {
                return false;
            }

            String[] rowData = data.split(",");
            tableModel.insertRow(row, rowData);

            Rectangle rect = table.getCellRect(row, 0, false);
            if (rect != null) {
                table.scrollRectToVisible(rect);
            }

            // demo stuff - remove for blog
            model.removeAllElements();
            model.insertElementAt(getNextString(count++), 0);
            // end demo stuff

            return true;
        }
    });

    JList dragFrom = new JList(model);
    dragFrom.setFocusable(false);
    dragFrom.setPrototypeCellValue(getNextString(100));
    model.insertElementAt(getNextString(count++), 0);
    dragFrom.setDragEnabled(true);
    dragFrom.setBorder(BorderFactory.createLoweredBevelBorder());

    dragFrom.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent me) {
            if (SwingUtilities.isLeftMouseButton(me) && me.getClickCount() % 2 == 0) {
                String text = (String) model.getElementAt(0);
                String[] rowData = text.split(",");
                tableModel.insertRow(table.getRowCount(), rowData);
                model.removeAllElements();
                model.insertElementAt(getNextString(count++), 0);
            }
        }
    });

    JPanel p = new JPanel();
    p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
    JPanel wrap = new JPanel();
    wrap.add(new JLabel("Drag from here:"));
    wrap.add(dragFrom);
    p.add(Box.createHorizontalStrut(4));
    p.add(Box.createGlue());
    p.add(wrap);
    p.add(Box.createGlue());
    p.add(Box.createHorizontalStrut(4));
    getContentPane().add(p, BorderLayout.NORTH);

    JScrollPane sp = new JScrollPane(table);
    getContentPane().add(sp, BorderLayout.CENTER);
    fillBox = new JCheckBoxMenuItem("Fill Viewport Height");
    fillBox.addActionListener(this);

    JMenuBar mb = new JMenuBar();
    JMenu options = new JMenu("Options");
    mb.add(options);
    setJMenuBar(mb);

    JMenuItem clear = new JMenuItem("Reset");
    clear.addActionListener(this);
    options.add(clear);
    options.add(fillBox);

    getContentPane().setPreferredSize(new Dimension(260, 180));
}

From source file:forge.screens.deckeditor.DeckImport.java

/**
 * Instantiates a new deck import.//from   ww  w.jav a  2s .c o  m
 * 
 * @param g
 *            the g
 */
public DeckImport(final ACEditorBase<TItem, TModel> g) {
    this.host = g;

    final int wWidth = 700;
    final int wHeight = 600;

    this.setPreferredSize(new java.awt.Dimension(wWidth, wHeight));
    this.setSize(wWidth, wHeight);
    this.setTitle("Deck Importer");

    txtInput.setFocusable(true);
    txtInput.setEditable(true);

    FSkin.SkinColor foreColor = FSkin.getColor(FSkin.Colors.CLR_TEXT);
    this.scrollInput.setBorder(new FSkin.TitledSkinBorder(BorderFactory.createEtchedBorder(),
            "Paste or type a decklist", foreColor));
    this.scrollOutput.setBorder(new FSkin.TitledSkinBorder(BorderFactory.createEtchedBorder(),
            "Expect the recognized lines to appear", foreColor));
    this.scrollInput.setViewportBorder(BorderFactory.createLoweredBevelBorder());
    this.scrollOutput.setViewportBorder(BorderFactory.createLoweredBevelBorder());

    this.add(this.scrollInput, "cell 0 0, w 50%, growy, pushy");
    this.add(this.newEditionCheck, "cell 0 1, w 50%, ax c");
    this.add(this.dateTimeCheck, "cell 0 2, w 50%, ax c");

    this.add(monthDropdown, "cell 0 3, w 20%, ax left, split 2, pad 0 4 0 0");
    this.add(yearDropdown, "w 15%");
    fillDateDropdowns();

    this.add(this.onlyCoreExpCheck, "cell 0 4, w 50%, ax c");

    this.add(this.scrollOutput, "cell 1 0, w 50%, growy, pushy");
    this.add(this.summaryMain, "cell 1 1, label");
    this.add(this.summarySide, "cell 1 2, label");

    this.add(this.cmdAccept, "cell 1 4, split 2, w 150, align r, h 26");
    this.add(this.cmdCancel, "w 150, h 26");

    this.cmdCancel.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
            DeckImport.this.processWindowEvent(new WindowEvent(DeckImport.this, WindowEvent.WINDOW_CLOSING));
        }
    });

    this.cmdAccept.addActionListener(new ActionListener() {
        @SuppressWarnings("unchecked")
        @Override
        public void actionPerformed(final ActionEvent e) {
            final String warning = "This will replace contents of your currently open deck with whatever you are importing. Proceed?";
            if (!FOptionPane.showConfirmDialog(warning, "Replacing old deck")) {
                return;
            }
            final Deck toSet = DeckImport.this.buildDeck();
            DeckImport.this.host.getDeckController().setModel((TModel) toSet);
            DeckImport.this.processWindowEvent(new WindowEvent(DeckImport.this, WindowEvent.WINDOW_CLOSING));
        }
    });

    ActionListener updateDateCheck = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            boolean isSel = dateTimeCheck.isSelected();
            monthDropdown.setEnabled(isSel);
            yearDropdown.setEnabled(isSel);
            parseAndDisplay();
        }
    };
    this.dateTimeCheck.addActionListener(updateDateCheck);

    ActionListener reparse = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            parseAndDisplay();
        }
    };
    this.newEditionCheck.addActionListener(reparse);
    this.onlyCoreExpCheck.addActionListener(reparse);
    this.yearDropdown.addActionListener(reparse);
    this.monthDropdown.addActionListener(reparse);
    updateDateCheck.actionPerformed(null); // update actual state

    this.txtInput.getDocument().addDocumentListener(new OnChangeTextUpdate());
    this.cmdAccept.setEnabled(false);
}

From source file:com.choicemaker.cm.modelmaker.gui.panels.HoldVsAccuracyPlotPanel.java

JPanel getPanel(JTable table, String title) {
    JScrollPane pane = new JScrollPane();
    pane.getViewport().add(table);//from www  .  j  ava  2  s .  co m
    pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5),
            BorderFactory.createLoweredBevelBorder()));
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(BorderFactory.createTitledBorder(title));
    panel.add(pane, BorderLayout.CENTER);
    return panel;
}

From source file:net.schweerelos.parrot.ui.GraphViewComponent.java

public GraphViewComponent() {
    super();//from  w  w w  . ja  v a  2s . c o  m
    setLayout(new GridBagLayout());
    setBorder(
            BorderFactory.createCompoundBorder(
                    BorderFactory.createEmptyBorder(PADDING_NODE_BORDER, PADDING_NODE_BORDER,
                            PADDING_NODE_BORDER, PADDING_NODE_BORDER),
                    BorderFactory.createLoweredBevelBorder()));

    layout = new NodeWrapperPersistentLayoutImpl(new CircleLayout<NodeWrapper, NodeWrapper>(
            new DirectedSparseMultigraph<NodeWrapper, NodeWrapper>()));
    vv = new VisualizationViewer<NodeWrapper, NodeWrapper>(layout);

    setupRenderContext(vv);

    view = new JScrollPane(vv);
    add(view, CONTENT_CONSTRAINTS);
}