Package java.awt

Examples of java.awt.Container


        pack();
        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    }

    protected void createContent(){
        Container content = getContentPane();
        content.setLayout(new BorderLayout());

        // HeaderPanel
        headerPanel = new HeaderPanel(true);
        headerPanel.setTitle(resources.getString("pageSetup"));  
        headerPanel.displayInfo(resources.getString("pageSetupTip"));
        content.add(headerPanel, BorderLayout.NORTH);

        // Inner panel
        GridBagPanel pageSetupPanel = new GridBagPanel();
        GridBagPanel pageModePanel = new GridBagPanel();
        GridBagPanel pageFormatPanel = new GridBagPanel( resources.getStringValue("pageFormat"));
 
        // Mode
        normalView = resources.getRadioButton("layoutMode", this);
        printView = resources.getRadioButton("pageMode", this);
        normalView.setSelected(false);
        printView.setSelected(false);
       
        ButtonGroup modeGroup = new ButtonGroup();
        modeGroup.add(normalView);
        modeGroup.add(printView);

        pageModePanel.addOnCurrentRow(normalView);
        pageModePanel.carriageReturn();
        pageModePanel.addOnCurrentRow(printView);
        pageModePanel.carriageReturn();
               
        // Format
        paperFormatList = new JComboBox( pageFormats );
        paperFormatList.addActionListener(this);
       
        SpinnerNumberModel heightSpi = new SpinnerNumberModel();
        heightSpi.setStepSize(new Integer(1));
        heightSpi.setMinimum(new Integer(50));
        heightSpi.setMaximum(new Integer(10000));
        heightSpi.setValue(new Integer(1));
        height = new JSpinner(heightSpi);
       
        SpinnerNumberModel widthSpi = new SpinnerNumberModel();
        widthSpi.setStepSize(new Integer(1));
        widthSpi.setMinimum(new Integer(50));
        widthSpi.setMaximum(new Integer(10000));
        widthSpi.setValue(new Integer(1));
        width = new JSpinner(widthSpi);

        lformat = resources.getLabel("format");
        pageFormatPanel.addOnCurrentRow(lformat);
        pageFormatPanel.addOnCurrentRow(paperFormatList);


        portrait = resources.getRadioButton("portrait", this);
        landscape = resources.getRadioButton("landscape", this);
        portrait.setSelected(false);
        landscape.setSelected(false);
       
      /*  orientationGroup = new ButtonGroup();
        orientationGroup.add(portrait);
        orientationGroup.add(landscape);*/

        pageFormatPanel.addOnCurrentRow(portrait);
        pageFormatPanel.addOnCurrentRow(landscape);
        pageFormatPanel.carriageReturn();
        lwidth = resources.getLabel("width");
        pageFormatPanel.addOnCurrentRow(lwidth);
        pageFormatPanel.addOnCurrentRow(width);
        pageFormatPanel.carriageReturn();
       
        lheight = resources.getLabel("height");
        pageFormatPanel.addOnCurrentRow(lheight);
        pageFormatPanel.addOnCurrentRow(height);
        pageFormatPanel.carriageReturn();
       

        // Add all panels
        pageSetupPanel.addOnCurrentRow(pageModePanel, 3, true, true, true);
        pageSetupPanel.addOnCurrentRow(pageFormatPanel, 3, true, true, false);
        content.add(pageSetupPanel, BorderLayout.CENTER);
       
        // Buttons
        JPanel navigationBarPanel = new JPanel(new BorderLayout());
        JPanel navigationBar = new JPanel();
        closeButton = resources.getButton("closeButton", this);
        okButton = resources.getButton("okButton", this)
        navigationBar.add(okButton);
        navigationBar.add(closeButton);
        navigationBarPanel.add(navigationBar, BorderLayout.EAST);
        content.add(navigationBarPanel,BorderLayout.SOUTH);
    }
View Full Code Here


   
    if ( (dsi==null) ||(dialog!=null)){
      return null
    }
    dialog = new JDialog( parent, resources.getString("dataSourceInformation"), false);
    Container contentPane = dialog.getContentPane();

    JPanel p  = new JPanel();
    Border paneEdge = BorderFactory.createEmptyBorder(0,10,10,10);
    p.setBorder(paneEdge);
    p.setLayout(new BoxLayout(p,BoxLayout.Y_AXIS));

    p.add(dsi);   
   
    contentPane.add(p,BorderLayout.CENTER);
    contentPane.add(createButtonPanel(), BorderLayout.SOUTH);

    if (JDialog.isDefaultLookAndFeelDecorated()) {
      boolean supportsWindowDecorations =
        UIManager.getLookAndFeel().getSupportsWindowDecorations();
      if (supportsWindowDecorations) {
View Full Code Here

  }

  public void testPlaceDialog() {
    Dialog d = new JDialog();
    d.setSize(50, 50);
    Container c = new JWindow();
    c.setBounds(100, 200, 100, 50);
   
    Util.placeDialog(d, c);
    assertEquals(125, d.getX());
    assertEquals(200, d.getY());
   
    // Test upper left corner
    c.setBounds(0,0,100,100);
    d.setSize(200, 200);
   
    Util.placeDialog(d, c);
    assertEquals(0, d.getX());
    assertEquals(0, d.getY());
View Full Code Here

                    frame.pack();
                }
            }
        );

        Container c = frame.getContentPane();
        c.add(playerpanel);

        frame.pack();
        frame.setVisible(true);

        //  Execute implementation-specific functionality
View Full Code Here

  players[master].addControllerListener(new PlayerListener());

        //  Show each Player's Visual Component
        for(int i = 0; i < players.length; i++) {
            JFrame f = new JFrame();
      Container pane = f.getContentPane();

            pane.setLayout( new BorderLayout() );

            Component vis =
                players[i].getVisualComponent();

            if ( vis != null ) {
                pane.add(vis, BorderLayout.CENTER);
            }

            if( i == master ) {
                f.setTitle("Master Player");
    f.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
      System.exit(0);
        }
                });

                Component cont =
                    players[i].getControlPanelComponent();

                if( cont != null ) {
                    pane.add(cont, BorderLayout.SOUTH);
                }
            } else {
                f.setTitle("Managed Controller");
            }
View Full Code Here

    frame.setTitle("Select Capture Device");
    frame.setModal(true);
    //frame.setSize(new Dimension(640, 480));
    //frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   
    Container contentPane = frame.getContentPane();
    CaptureDeviceBrowser panel = new CaptureDeviceBrowser();
    contentPane.add(panel);
    frame.pack();
    if (parent != null)
      frame.setLocationRelativeTo(parent);
    frame.setVisible(true);
    MediaLocator result = panel.okClicked ? panel.getSelectedMediaLocator() : null;
View Full Code Here

   
    try {
      RegistryEditorPanel panel = new RegistryEditorPanel();
     
      JFrame frame = new JFrame("Registry Editor");
      Container contentPane = frame.getContentPane();
      contentPane.setLayout(new BorderLayout());
      contentPane.add(panel, BorderLayout.CENTER);
     
      //frame.setMinimumSize(new Dimension(480, 320));  // doesn't seem to have any effect (at least in linux), and is not 1.4-compatible anyway.
      frame.setSize(640, 480);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setVisible(true);
View Full Code Here

    frame = new JFrame("FMJ Studio");
    frame.setSize(new Dimension(640, 480));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

   
    Container contentPane = frame.getContentPane();
    playerPanel = new PlayerPanel();
    contentPane.add(playerPanel);
   
    frame.setMenuBar(getMenuBar());
   
        //  Resize frame whenever new Component is added
    playerPanel.getVideoPanel().addContainerListener(
View Full Code Here

  private void onOpenRegistryEditor() {
    if (registryFrame == null) {
      registryFrame = new JFrame("Registry Editor");
      RegistryEditorPanel panel = new RegistryEditorPanel();

      Container contentPane = registryFrame.getContentPane();
      contentPane.setLayout(new BorderLayout());
      contentPane.add(panel, BorderLayout.CENTER);
     
      //frame.setMinimumSize(new Dimension(480, 320));  // doesn't seem to have any effect (at least in linux), and is not 1.4-compatible anyway.
      registryFrame.setSize(640, 480);
    }
    registryFrame.setVisible(true);
View Full Code Here

  System.out.println(c.getClass().getName() + "(" +
         (c.getParent() == null ?
        "null" :
        c.getParent().getClass().getName()) + ")");
  if (c instanceof Container)   {
      Container con = (Container) c;
      for (int i = 0; i < con.getComponentCount(); i++)
    printComponent(level+1, con.getComponent(i));
  }
    }
View Full Code Here

TOP

Related Classes of java.awt.Container

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.