Search in sources :

Example 56 with Dimension

use of java.awt.Dimension in project pcgen by PCGen.

the class OpposedCheckDialog method getOpposingGroupScrollPane.

/**
	 *
	 * This method initializes opposingGroupScrollPane
	 *
	 * @return javax.swing.JScrollPane
	 *
	 */
private Component getOpposingGroupScrollPane() {
    if (opposingGroupScrollPane == null) {
        opposingGroupScrollPane = new JScrollPane();
        opposingGroupScrollPane.setViewportView(getOpposingGroupTable());
        opposingGroupScrollPane.setPreferredSize(new Dimension(300, 100));
    }
    return opposingGroupScrollPane;
}
Also used : JScrollPane(javax.swing.JScrollPane) Dimension(java.awt.Dimension)

Example 57 with Dimension

use of java.awt.Dimension in project android_frameworks_base by ResurrectionRemix.

the class UI method updateWaitDialog.

public void updateWaitDialog(String s) {
    if (currentWaitDialog != null) {
        ((JLabel) currentWaitDialog.getContentPane().getComponent(0)).setText(s);
        Dimension prefSize = currentWaitDialog.getPreferredSize();
        Dimension curSize = currentWaitDialog.getSize();
        if (prefSize.width > curSize.width || prefSize.height > curSize.height) {
            currentWaitDialog.setSize(Math.max(prefSize.width, curSize.width), Math.max(prefSize.height, curSize.height));
            currentWaitDialog.invalidate();
        }
    }
}
Also used : JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 58 with Dimension

use of java.awt.Dimension in project SIMRacingApps by SIMRacingApps.

the class MainFrame method createInstance.

public static void createInstance() {
    try {
        Toolkit.getDefaultToolkit().setDynamicLayout(true);
        System.setProperty("sun.awt.noerasebackground", "true");
        // JGoodies
        // menu icons
        Options.setDefaultIconSize(new Dimension(16, 16));
        Options.setUseNarrowButtons(false);
        Options.setPopupDropShadowEnabled(true);
        UIManager.setLookAndFeel(System.getProperty("os.name").toLowerCase().startsWith("windows") ? new WindowsLookAndFeel() : new PlasticXPLookAndFeel());
        _instance = new MainFrame();
    } catch (Exception e) {
        System.err.println(e);
    }
}
Also used : PlasticXPLookAndFeel(com.jgoodies.looks.plastic.PlasticXPLookAndFeel) Dimension(java.awt.Dimension) WindowsLookAndFeel(com.jgoodies.looks.windows.WindowsLookAndFeel) ExecException(net.sf.launch4j.ExecException) InvariantViolationException(net.sf.launch4j.binding.InvariantViolationException) BuilderException(net.sf.launch4j.BuilderException) ConfigPersisterException(net.sf.launch4j.config.ConfigPersisterException) BindingException(net.sf.launch4j.binding.BindingException)

Example 59 with Dimension

use of java.awt.Dimension in project pcgen by PCGen.

the class DiceBagView method setupEditMode.

/**
	 * <p>Sets up the editing mode; cleans components and then
	 * displays the editing component setup.</p>
	 */
private void setupEditMode() {
    cleanup();
    getContentPane().add(m_center, BorderLayout.CENTER);
    getContentPane().add(m_top, BorderLayout.NORTH);
    m_top.add(m_topTop);
    m_top.add(m_topBottom);
    m_nameField.setPreferredSize(new Dimension(100, m_nameField.getPreferredSize().height));
    m_topBottom.add(m_nameFieldLabel);
    m_topBottom.add(m_nameField);
    m_nameField.setText(m_bag.getName());
    if (m_center.getLayout() instanceof DiceBagGridLayout) {
        ((DiceBagGridLayout) m_center.getLayout()).setRows(1);
        ((DiceBagGridLayout) m_center.getLayout()).setColumns(1);
    }
    m_center.add(m_scrollPane);
    m_topTop.add(m_stopEditing);
    m_topTop.add(Box.createHorizontalStrut(5));
    m_topTop.add(m_deleteSelected);
    m_topTop.add(Box.createHorizontalStrut(5));
    m_topTop.add(m_moveUp);
    m_topTop.add(Box.createHorizontalStrut(5));
    m_topTop.add(m_moveDown);
    m_table.setPreferredScrollableViewportSize(new Dimension(m_table.getPreferredScrollableViewportSize().width, 200));
    getContentPane().validate();
    pack();
}
Also used : Dimension(java.awt.Dimension)

Example 60 with Dimension

use of java.awt.Dimension 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)

Aggregations

Dimension (java.awt.Dimension)4003 JPanel (javax.swing.JPanel)1091 JLabel (javax.swing.JLabel)742 Point (java.awt.Point)683 JButton (javax.swing.JButton)671 ActionEvent (java.awt.event.ActionEvent)644 ActionListener (java.awt.event.ActionListener)583 JScrollPane (javax.swing.JScrollPane)558 BorderLayout (java.awt.BorderLayout)492 Insets (java.awt.Insets)411 BoxLayout (javax.swing.BoxLayout)334 GridBagLayout (java.awt.GridBagLayout)312 GridBagConstraints (java.awt.GridBagConstraints)266 FlowLayout (java.awt.FlowLayout)242 JTextField (javax.swing.JTextField)235 ImageIcon (javax.swing.ImageIcon)216 Component (java.awt.Component)215 Color (java.awt.Color)205 ChangeEvent (javax.swing.event.ChangeEvent)200 ChangeListener (javax.swing.event.ChangeListener)198