Package java.awt

Examples of java.awt.GridLayout


  private JButton mRightBt, mLeftBt, mUpBt, mDownBt;
  private ArrayList<CustomizableItemsListener> mListeners;
 

  public CustomizableItemsPanel(String leftText, String rightText) {
    super(new GridLayout(1,2));

    mListeners = new ArrayList<CustomizableItemsListener>();
    String msg;

    JPanel leftPanel=new JPanel(new BorderLayout());
    JPanel rightPanel=new JPanel(new BorderLayout());

    mLeftListModel = new DefaultListModel();
    mLeftList = new JList(mLeftListModel);
    mLeftList.setVisibleRowCount(10);
    mLeftList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    mLeftList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent evt) {
        updateEnabled();
      }
    });

    mRightListModel = new DefaultListModel();
    mRightList = new JList(mRightListModel);
    mRightList.setVisibleRowCount(10);
    mRightList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    mRightList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent evt) {
        updateEnabled();
      }
    });

    mLeftList.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        fireLeftListSelectionChanged(e);
      }
    }
    );

    mRightList.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        fireRightListSelectionChanged(e);
      }
    }
    );

    mLeftLabel=new JLabel(leftText);
    mRightLabel=new JLabel(rightText);

    mLeftLabel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
    mRightLabel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));

    leftPanel.add(mLeftLabel,BorderLayout.NORTH);
    rightPanel.add(mRightLabel,BorderLayout.NORTH);

    leftPanel.add(new JScrollPane(mLeftList),BorderLayout.CENTER);
    rightPanel.add(new JScrollPane(mRightList),BorderLayout.CENTER);

    JPanel leftButtons=new JPanel(new GridLayout(2,1));
    JPanel rightButtons=new JPanel(new GridLayout(2,1));

    JPanel panel2=new JPanel(new BorderLayout());
    JPanel panel3=new JPanel(new BorderLayout());
    JPanel panel4=new JPanel(new BorderLayout());
    JPanel panel5=new JPanel(new BorderLayout());
View Full Code Here


* section to the associated existing aggregate widget
*/
protected JPanel buildAggregatesEditor(HashMap aggregates) {
    Object[] functionNames = AggregateField.functionNameArray();
    JPanel panel = new JPanel();
    panel.setLayout(new GridLayout(0, 1));
    panel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
    JCheckBox cb = null;
    JComboBox menu = null;
    slots = new HashMap();

View Full Code Here

    channelLabel.setIcon(UiUtilities.createChannelIcon(program.getChannel().getIcon()));
    channelLabel.setVerticalTextPosition(SwingConstants.BOTTOM);
    channelLabel.setHorizontalTextPosition(SwingConstants.CENTER);

    JLabel titleLabel=new JLabel(program.getTitle());
    JPanel infoPanel=new JPanel(new GridLayout(2,1));

    Font font=titleLabel.getFont();

    titleLabel.setFont(new Font(font.getName(),Font.BOLD,font.getSize()+4));
View Full Code Here

   * @return the panel.
   */
  private JPanel getCalendarPanel()
  {

    final JPanel p = new JPanel(new GridLayout(7, 7));
    final DateFormatSymbols dateFormatSymbols = new DateFormatSymbols();
    final String[] weekDays = dateFormatSymbols.getShortWeekdays();

    for (int i = 0; i < this.WEEK_DAYS.length; i++)
    {
View Full Code Here

  protected JPanel createButtonPanel()
  {
    final JButton btnCancel = new ActionButton(getCancelAction());
    final JButton btnConfirm = new ActionButton(getConfirmAction());
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(1, 2, 5, 5));
    buttonPanel.add(btnConfirm);
    buttonPanel.add(btnCancel);
    btnConfirm.setDefaultCapable(true);
    getRootPane().setDefaultButton(btnConfirm);
    buttonPanel.registerKeyboardAction(getConfirmAction(),
View Full Code Here

    final JScrollPane scrollPane = new JScrollPane(carrierPanel);
    scrollPane.getViewport().setBackground(carrierPanel.getBackground());
    add(scrollPane, gbc);

    final JPanel buttonPane = new JPanel();
    buttonPane.setLayout(new GridLayout(1, 1));
    buttonPane.add(updateButton);
    gbc = new GridBagConstraints();
    gbc.gridy = 2;
    gbc.gridx = 1;
    gbc.anchor = GridBagConstraints.EAST;
    add(buttonPane, gbc);

    final JPanel cbPane = new JPanel();
    cbPane.setLayout(new GridLayout(1, 1));
    cbPane.add(autoUpdateCheckbox);
    gbc = new GridBagConstraints();
    gbc.gridy = 2;
    gbc.gridx = 0;
    gbc.anchor = GridBagConstraints.WEST;
View Full Code Here

  }

  private JPanel createAboutTab()
  {
    final JPanel textPanel = new JPanel(new GridLayout(4, 1, 0, 4));

    final JPanel appPanel = new JPanel();
    final JLabel appLabel = new JLabel(application);
    appLabel.setHorizontalTextPosition(SwingConstants.CENTER);
    appPanel.add(appLabel);
View Full Code Here

  private JPanel createButtonPanel()
  {
    final JButton btnCancel = new ActionButton(getCancelAction());
    final JButton btnConfirm = new ActionButton(getConfirmAction());
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(1, 2, 5, 5));
    buttonPanel.add(btnConfirm);
    buttonPanel.add(btnCancel);
    btnConfirm.setDefaultCapable(true);
    getRootPane().setDefaultButton(btnConfirm);
    buttonPanel.registerKeyboardAction(getConfirmAction(),
View Full Code Here

public class DisplayParentTest extends Frame {
  boolean killswitch;
  public DisplayParentTest() throws LWJGLException {
    setTitle("LWJGL Display Parent Test");
    setSize(640, 320);
    setLayout(new GridLayout(1, 2));
    final Canvas display_parent = new Canvas();
    display_parent.setFocusable(true);
    display_parent.setIgnoreRepaint(true);
    add(display_parent);
    addWindowListener(new WindowAdapter() {
View Full Code Here

   * C'tor
   */
  public AWTTest() throws LWJGLException {
    setTitle("LWJGL AWT Canvas Test");
    setSize(640, 320);
    setLayout(new GridLayout(1, 2));
    add(canvas0 = new AWTGLCanvas() {
      int current_height;
      int current_width;
      public void paintGL() {
        try {
View Full Code Here

TOP

Related Classes of java.awt.GridLayout

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.