java.awt.GridLayout Java Examples

The following examples show how to use java.awt.GridLayout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DialogSupport.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/** Create a panel with buttons that will be placed according
 * to the required alignment */
private JPanel createButtonPanel( JButton[] buttons, boolean sidebuttons ) {
    int count = buttons.length;
    
    JPanel outerPanel = new JPanel( new BorderLayout() );
    outerPanel.setBorder( new EmptyBorder( new Insets(
            sidebuttons ? 5 : 0, sidebuttons ? 0 : 5, 5, 5 ) ) );

    LayoutManager lm = new GridLayout( // GridLayout makes equal cells
            sidebuttons ? count : 1, sidebuttons ? 1 : count,  5, 5 );
        
    JPanel innerPanel = new JPanel( lm );
    
    for( int i = 0; i < count; i++ ) innerPanel.add( buttons[i] );
    
    outerPanel.add( innerPanel,
        sidebuttons ? BorderLayout.NORTH : BorderLayout.EAST ) ;
    return outerPanel;
}
 
Example #2
Source File: OptionsEtcPanel.java    From rest-client with Apache License 2.0 6 votes vote down vote up
OptionsEtcPanel(){
    this.setLayout(new FlowLayout(FlowLayout.LEFT));
    jcb_indentResponse.setMnemonic('a');

    jcb_syntaxRequest.setToolTipText("Requires RESTClient restart!");
    jcb_syntaxResponse.setToolTipText("Requires RESTClient restart!");
    
    JPanel jp = new JPanel();
    jp.setLayout(new GridLayout(4, 1));
    
    jp.add(jcb_indentResponse);
    jp.add(jcb_syntaxRequest);
    jp.add(jcb_syntaxResponse);
    JPanel jp_scrollSpeed = new JPanel(new BorderLayout());
    JPanel jp_scrollSpeed_inner = new JPanel(new FlowLayout());
    jp_scrollSpeed_inner.add(new JLabel("Text areas scroll speed"));
    jp_scrollSpeed_inner.add(js_scrollSpeed);
    jp_scrollSpeed.add(BorderLayout.WEST, jp_scrollSpeed_inner);
    jp.add(jp_scrollSpeed);
    ((JSpinner.DefaultEditor)js_scrollSpeed.getEditor()).getTextField().setColumns(2);
    
    this.add(jp);
}
 
Example #3
Source File: PasswordPane.java    From Qora with MIT License 6 votes vote down vote up
public static String showUnlockWalletDialog()
{
	JPanel userPanel = new JPanel();
	userPanel.setLayout(new GridLayout(2,2));

	//Labels for the textfield components        
	JLabel passwordLbl = new JLabel("Enter wallet password:");
	JPasswordField passwordFld = new JPasswordField();

	//Add the components to the JPanel        
	userPanel.add(passwordLbl);
	userPanel.add(passwordFld);

	//As the JOptionPane accepts an object as the message
	//it allows us to use any component we like - in this case 
	//a JPanel containing the dialog components we want
	if(JOptionPane.showConfirmDialog(null, userPanel, "Unlock Wallet" ,JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION)
	{
		return new String(passwordFld.getPassword());
	}
	
	return "";
}
 
Example #4
Source File: AudioTimestampSelector.java    From GpsPrune with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Create the GUI components
 * @param inTopLabelKey key for description label at top
 * @param inLowerLabelKey key for description label at bottom, if any
 */
private void createComponents(String inTopLabelKey, String inLowerLabelKey)
{
	setLayout(new BorderLayout());
	add(new JLabel(I18nManager.getText(inTopLabelKey)), BorderLayout.NORTH);
	// panel for the radio buttons
	JPanel gridPanel = new JPanel();
	gridPanel.setLayout(new GridLayout(0, 3, 15, 3));
	final String[] keys = {"beginning", "middle", "end"};
	ButtonGroup group = new ButtonGroup();
	for (int i=0; i<3; i++)
	{
		_radios[i] = new JRadioButton(I18nManager.getText("dialog.correlate.timestamp." + keys[i]));
		group.add(_radios[i]);
		gridPanel.add(_radios[i]);
	}
	_radios[0].setSelected(true);
	add(gridPanel, BorderLayout.CENTER);
	if (inLowerLabelKey != null) {
		add(new JLabel(I18nManager.getText(inLowerLabelKey)), BorderLayout.SOUTH);
	}
}
 
Example #5
Source File: HouseholdsPanel.java    From computational-economy with GNU General Public License v3.0 6 votes vote down vote up
public HouseholdsPanelForCurrency(final Currency currency) {
	this.currency = currency;

	setLayout(new GridLayout(0, 3));

	this.add(createUtilityPanel(currency));
	// this.add(createUtilityFunctionMechanicsPanel(currency));
	this.add(createIncomeConsumptionSavingPanel(currency));
	this.add(createConsumptionSavingRatePanel(currency));
	this.add(createWageDividendPanel(currency));
	this.add(createIncomeSourcePanel(currency));
	incomeDistributionChart = createIncomeDistributionPanel(currency);
	this.add(new ChartPanel(incomeDistributionChart));
	this.add(createLorenzCurvePanel(currency));
	this.add(createHouseholdBalanceSheetPanel(currency));
	this.add(createLabourHourSupplyPanel(currency));
	this.add(createPricingBehaviourMechanicsPanel(currency, GoodType.LABOURHOUR));

	ApplicationContext.getInstance().getModelRegistry()
			.getNationalEconomyModel(currency).householdsModel.incomeDistributionModel.registerListener(this);
	// no registration with the price and market depth model, as they
	// call listeners synchronously

	notifyListener();
}
 
Example #6
Source File: TreeTableMemoryLeakTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
public void run() {

    // create panel (implementing ExplorerManager.Provider) with TTV
    MyPanel panel = new MyPanel();
    panel.setLayout(new GridLayout(1, 2));
    ttv = new TreeTableView();
    panel.add(ttv);

    // set root and keep the same root
    panel.setExplorerManagerRoot(root);


    //comment the next line to make the test works
    ttv.expandNode(root);

    // remove child
    children.remove(new Node[]{child});
    root = null;
    children = null;
}
 
Example #7
Source File: LoadingView.java    From java-photoslibrary with Apache License 2.0 6 votes vote down vote up
private LoadingView() {
  UIHelper.setFixedSize(this, LOADING_DIMENSION);
  setTitle("Loading");
  moveToCenter();
  setResizable(false);
  setAlwaysOnTop(true);
  setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

  JProgressBar progressBar = new JProgressBar();
  progressBar.setIndeterminate(true);

  JPanel panel = new JPanel();
  panel.setBorder(BORDER);
  panel.setLayout(new GridLayout(1 /* rows */, 1 /* cols */));
  panel.add(progressBar);

  add(panel);
}
 
Example #8
Source File: CControlsPanel.java    From binnavi with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new control settings panel.
 *
 * @param settings Settings object that provides the graph settings to display.
 */
public CControlsPanel(final ZyGraphViewSettings settings) {
  super(new GridLayout(3, 1));
  setBorder(new TitledBorder("Controls"));

  CSettingsPanelBuilder.addComboBox(this,
      mouseWheelBehaviorBox,
      "Mousewheel Action" + ":",
      "Specifies whether the mousewheel is used for zooming or scrolling in graph windows.",
      new String[] {"Zoom", "Scroll"},
      settings.getMouseSettings().getMouseWheelAction().ordinal());

  CSettingsPanelBuilder.addDoubleSlider(this, m_tfScrollSensitivity, "Scroll Sensitivity" + ":",
      "Mouse sensitivity during scroll operations.",
      settings.getMouseSettings().getScrollSensitivity() / 5);

  CSettingsPanelBuilder.addDoubleSlider(this, m_tfZoomSensitivity, "Zoom Sensitivity" + ":",
      "Mouse sensitivity during zoom operations.",
      settings.getMouseSettings().getZoomSensitivity() / 5);
}
 
Example #9
Source File: Regression_119808.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
ControlPanel( Regression_119808 siv )
{
	this.siv = siv;

	setLayout( new GridLayout( 0, 1, 0, 0 ) );

	JPanel jp = new JPanel( );
	jp.setLayout( new FlowLayout( FlowLayout.LEFT, 3, 3 ) );

	jp.add( new JLabel( "Choose:" ) );//$NON-NLS-1$
	jcbModels = new JComboBox( );

	jcbModels.addItem( "Bar Chart" );
	jcbModels.setSelectedIndex( 0 );
	jp.add( jcbModels );

	jbUpdate = new JButton( "Update" );//$NON-NLS-1$
	jbUpdate.addActionListener( this );
	jp.add( jbUpdate );

	add( jp );
}
 
Example #10
Source File: EmployeeFrame.java    From JavaMainRepo with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param title
 *            The title of the frame.
 */
public EmployeeFrame(final String title) {
	super(title);
	contentPanel.setLayout(new GridLayout(0, 1, 0, 0));
	JPanel pan = new JPanel();
	contentPanel.add(pan);
	SpringLayout slPanel = new SpringLayout();
	pan.setLayout(slPanel);
	Caretaker = new JButton("Caretaker");
	slPanel.putConstraint(SpringLayout.NORTH, Caretaker, 180, SpringLayout.NORTH, pan);
	slPanel.putConstraint(SpringLayout.WEST, Caretaker, 280, SpringLayout.WEST, pan);
	pan.add(Caretaker);
	JPanel panel_2 = new JPanel();
	contentPanel.add(panel_2);
	setVisible(true);
}
 
Example #11
Source File: ShareAlbumToolPanel.java    From java-photoslibrary with Apache License 2.0 6 votes vote down vote up
private JTextArea getMetadataTextArea(Album album) {
  JTextArea metadataTextArea = new JTextArea();
  metadataTextArea.setBorder(METADATA_BORDER);
  metadataTextArea.setLayout(
      new GridLayout(2 /* rows */, 1 /* cols */, 0 /* unset hgap */, 10 /* vgap */));
  metadataTextArea.setEditable(false);
  metadataTextArea.setLineWrap(true);
  metadataTextArea.append(String.format("URL: %s", album.getProductUrl()));
  if (album.hasShareInfo()) {
    metadataTextArea.append(
        String.format("\nShare URL: %s", album.getShareInfo().getShareableUrl()));
    metadataTextArea.append(
        String.format("\nShare Token: %s", album.getShareInfo().getShareToken()));
  }
  return metadataTextArea;
}
 
Example #12
Source File: InterfacesGeneralPane.java    From ApkToolPlus with Apache License 2.0 6 votes vote down vote up
protected void setupComponent() {
	addButton = new JButton("Add interface");
	name = new JTextField(15);

	JPanel namePanel = new JPanel();
	namePanel.setLayout(new GridLayout(2, 1));
	namePanel.add(new JLabel("Interface name"));
	namePanel.add(name);
	add(namePanel);

	JPanel buttonPanel = new JPanel();
	buttonPanel.setLayout(new GridLayout(2, 1));
	
	buttonPanel.add(new JLabel(""));
	buttonPanel.add(addButton);
       Border simpleBorder = BorderFactory.createEtchedBorder();
       Border border = BorderFactory.createTitledBorder(simpleBorder,
               "Add interface");
	this.setBorder(border);		
	add(buttonPanel);
	addButton.addActionListener(this);
	addButton.setActionCommand("add");
}
 
Example #13
Source File: SearchMediaItemView.java    From java-photoslibrary with Apache License 2.0 6 votes vote down vote up
/** Creates a border-layout panel with padding. */
private JPanel initializeContentPanel() {
  JPanel panel = new JPanel();
  panel.setLayout(new BorderLayout(0 /* hgap */, 20 /* vgap */));

  JScrollPane scrollPane =
      new JScrollPane(
          panel,
          JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
          JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
  scrollPane.setBorder(UIHelper.NO_BORDER);

  JPanel outerPanel = new JPanel();
  outerPanel.setLayout(new GridLayout(1 /* rows */, 1 /* cols */));
  outerPanel.setBorder(CONTENT_BORDER);
  outerPanel.add(scrollPane);
  add(outerPanel, BorderLayout.CENTER);

  return panel;
}
 
Example #14
Source File: PrintPreviewDialog.java    From pcgen with GNU Lesser General Public License v2.1 6 votes vote down vote up
private PrintPreviewDialog(PCGenFrame frame)
{
	super(frame, true);
	this.frame = frame;
	this.character = frame.getSelectedCharacterRef().get();
	this.previewPanelParent = new JPanel(new GridLayout(1, 1));
	this.sheetBox = new JComboBox<>();
	this.progressBar = new JProgressBar();
	this.pageBox = new JComboBox<>();
	this.zoomBox = new JComboBox<>();
	this.zoomInButton = new JButton();
	this.zoomOutButton = new JButton();
	this.printButton = new JButton();
	this.cancelButton = new JButton();
	initComponents();
	initLayout();
	pack();
	new SheetLoader().execute();
}
 
Example #15
Source File: SelectionAutoscrollTest.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
void createObjects() {
    textArea = new TextArea( bigString() );
    robot = Util.createRobot();

    Panel panel = new Panel();
    panel.setLayout( new GridLayout(3,3) );

    for( int y=0; y<3; ++y ) {
        for( int x=0; x<3; ++x ) {
            if( x==1 && y==1 ) {
                panel.add( textArea );
            } else {
                panel.add( new Panel() );
            }
        }
    }

    Frame frame = new Frame( "TextArea cursor icon test" );
    frame.setSize( 300, 300 );
    frame.add( panel );
    frame.setVisible( true );
}
 
Example #16
Source File: RawPacketSender.java    From Spark with Apache License 2.0 6 votes vote down vote up
public RawPacketSender() {

	_mainframe = new JFrame("Send Raw Packets");
	_mainframe.setIconImage(SparkRes.getImageIcon(SparkRes.MAIN_IMAGE)
		.getImage());
	_mainpanel = new JPanel();
	_mainpanel.setLayout(new GridLayout(2, 1));
	_textarea = new JTextArea();
	_inputarea = new JTextArea();
	_textscroller = new JScrollPane(_textarea);
	_sendButton = new JButton("Send",
		SparkRes.getImageIcon(SparkRes.SMALL_CHECK));
	_clear = new JButton("Clear",
		SparkRes.getImageIcon(SparkRes.SMALL_DELETE));

	createGUI();

    }
 
Example #17
Source File: MapEditorTransformPanel.java    From freecol with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a panel to choose a map transform.
 *
 * @param freeColClient The {@code FreeColClient} for the game.
 */
public MapEditorTransformPanel(FreeColClient freeColClient) {
    super(freeColClient, null, new BorderLayout());

    listPanel = new JPanel(new GridLayout(2, 0));

    group = new ButtonGroup();
    //Add an invisible, move button to de-select all others
    group.add(new JToggleButton());
    buildList();

    JScrollPane sl = new JScrollPane(listPanel,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    sl.getViewport().setOpaque(false);
    add(sl);
}
 
Example #18
Source File: DefaultPlugin.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 */
private static JComponent wrapDialogContent(JComponent comp,
                                            boolean selfResizing) {
    JComponent result;
    
    if ((comp.getBorder() != null) || selfResizing) {
        result = selfResizing ? new SelfResizingPanel() : new JPanel();
        result.setLayout(new GridLayout());
        result.add(comp);
    } else {
        result = comp;
    }
    result.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
    result.getAccessibleContext().setAccessibleDescription(bundle.getString("AD_title_select_generator"));
    return result;
}
 
Example #19
Source File: AFrame.java    From JavaMainRepo with Apache License 2.0 6 votes vote down vote up
public AFrame(String title) {
	super(title);
	contentPanel.setLayout(new GridLayout(0, 3, 0, 0));
	
	JPanel panel = new JPanel();
	contentPanel.add(panel);

	JPanel pan = new JPanel();
	contentPanel.add(pan);
	SpringLayout slPanel = new SpringLayout();
	pan.setLayout(slPanel);

	animalButton = new JButton("Animal");
	slPanel.putConstraint(SpringLayout.NORTH, animalButton, 65, SpringLayout.NORTH, pan);
	slPanel.putConstraint(SpringLayout.WEST, animalButton, 93, SpringLayout.WEST, pan);
	pan.add(animalButton);

	employeeButton = new JButton("Employee");
	slPanel.putConstraint(SpringLayout.NORTH, employeeButton, 100, SpringLayout.NORTH, pan);
	slPanel.putConstraint(SpringLayout.WEST, employeeButton, 93, SpringLayout.WEST, pan);
	pan.add(employeeButton);

	JPanel rightPanel = new JPanel();
	contentPanel.add(rightPanel);
	setVisible(true);
}
 
Example #20
Source File: TabbedPaneDemo.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public TabbedPaneDemo() {
    super(new GridLayout(1, 1));

    JTabbedPane tabbedPane = new JTabbedPane();
    ImageIcon icon = createImageIcon("images/middle.gif");

    JComponent panel1 = makeTextPanel("Panel #1");
    tabbedPane.addTab("Tab 1", icon, panel1, "Does nothing");
    tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);

    JComponent panel2 = makeTextPanel("Panel #2");
    tabbedPane.addTab("Tab 2", icon, panel2, "Does twice as much nothing");
    tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);

    JComponent panel3 = makeTextPanel("Panel #2");
    tabbedPane.addTab("Tab 3", icon, panel3, "Still does nothing");
    tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);

    JComponent panel4 = makeTextPanel("Panel #4 (has a preferred size of 410 x 50).");
    panel4.setPreferredSize(new Dimension(410, 50));
    tabbedPane.addTab("Tab 4", icon, panel4, "Does nothing at all");
    tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);

    // Add the tabbed pane to this panel.
    add(tabbedPane);

    // The following line enables to use scrolling tabs.
    tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
}
 
Example #21
Source File: NCteQFingerprintBrowser.java    From Panako with GNU Affero General Public License v3.0 5 votes vote down vote up
private JComponent createButtonPanel(){
	JPanel fileChooserPanel = new JPanel(new GridLayout(0,2));
	fileChooserPanel.setBorder(new TitledBorder("Actions"));
	
   final JFileChooser fileChooser = new JFileChooser();
	
	final JButton chooseFileButton = new JButton("Open...");
	chooseFileButton.addActionListener(new ActionListener(){
		@Override
		public void actionPerformed(ActionEvent arg0) {
			int returnVal = fileChooser.showOpenDialog(NCteQFingerprintBrowser.this);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                String audioFile = file.getAbsolutePath();
                setTitle("Fingerprints for: " + file.getName());
                addAudio(audioFile);
            } else {
                //canceled
            }
		}					
	});
	
	fileChooserPanel.add(chooseFileButton);
	
	
	return fileChooserPanel;
}
 
Example #22
Source File: TooltipAndTargetPanel.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Layout all inner components.
 */
public void layoutComponents() {
  final int basicIndent = 0;
  final int verticalGap = 2;
  final int horizontalGap = 4;

  setLayout( new GridLayout( 1, 2 ) );

  JPanel tgPanel = new JPanel();
  JPanel ttPanel = new JPanel();
  add( tgPanel );
  add( ttPanel );

  SpringLayout targetLayout = new SpringLayout();
  tgPanel.setLayout( targetLayout );
  tgPanel.add( targetLabel );
  targetLayout.putConstraint( SpringLayout.NORTH, targetLabel, basicIndent, SpringLayout.NORTH, tgPanel );
  targetLayout.putConstraint( SpringLayout.EAST, targetLabel, -horizontalGap, SpringLayout.EAST, tgPanel );
  targetLayout.putConstraint( SpringLayout.WEST, targetLabel, basicIndent, SpringLayout.WEST, tgPanel );
  tgPanel.add( targetComboBox );
  targetLayout.putConstraint( SpringLayout.NORTH, targetComboBox, verticalGap, SpringLayout.SOUTH, targetLabel );
  targetLayout.putConstraint( SpringLayout.EAST, targetComboBox, -horizontalGap, SpringLayout.EAST, tgPanel );
  targetLayout.putConstraint( SpringLayout.WEST, targetComboBox, basicIndent, SpringLayout.WEST, tgPanel );
  targetLayout.putConstraint( SpringLayout.SOUTH, tgPanel, basicIndent, SpringLayout.SOUTH, targetComboBox ); // Order is important! --Kaa

  SpringLayout tooltipLayout = new SpringLayout();
  ttPanel.setLayout( tooltipLayout );
  ttPanel.add( tooltipLabel );
  tooltipLayout.putConstraint( SpringLayout.NORTH, tooltipLabel, basicIndent, SpringLayout.NORTH, ttPanel );
  tooltipLayout.putConstraint( SpringLayout.EAST, tooltipLabel, basicIndent, SpringLayout.EAST, ttPanel );
  tooltipLayout.putConstraint( SpringLayout.WEST, tooltipLabel, 0, SpringLayout.WEST, ttPanel );
  ttPanel.add( tooltipPanel );
  tooltipLayout.putConstraint( SpringLayout.NORTH, tooltipPanel, verticalGap, SpringLayout.SOUTH, tooltipLabel );
  tooltipLayout.putConstraint( SpringLayout.EAST, tooltipPanel, basicIndent, SpringLayout.EAST, ttPanel );
  tooltipLayout.putConstraint( SpringLayout.WEST, tooltipPanel, 0, SpringLayout.WEST, ttPanel );
  tooltipLayout.putConstraint( SpringLayout.SOUTH, ttPanel, basicIndent, SpringLayout.SOUTH, tooltipPanel ); // Order is important! --Kaa
}
 
Example #23
Source File: CounterRequestDetailPanel.java    From javamelody with Apache License 2.0 5 votes vote down vote up
private JPanel createRequestRumDataPanel() {
	final JPanel rumDataPanel = new JPanel(new GridLayout(1, 4, 40, 0));
	final CounterRequestRumData rumData = request.getRumData();
	final DecimalFormat percentFormat = I18N.createPercentFormat();
	final DecimalFormat integerFormat = I18N.createIntegerFormat();
	final int networkTimeMean = rumData.getNetworkTimeMean();
	final int serverMean = request.getMean();
	final int domProcessingMean = rumData.getDomProcessingMean();
	final int pageRenderingMean = rumData.getPageRenderingMean();
	final int total = networkTimeMean + serverMean + domProcessingMean + pageRenderingMean;
	final double networkPercent = 100d * networkTimeMean / total;
	final double serverPercent = 100d * serverMean / total;
	final double domProcessingPercent = 100d * domProcessingMean / total;
	final double pageRenderingPercent = 100d * pageRenderingMean / total;

	final String networkLabel = I18N.getString("Network") + ": "
			+ integerFormat.format(networkTimeMean) + " ms ("
			+ percentFormat.format(networkPercent) + "%)";
	final String serverLabel = I18N.getString("Server") + " : "
			+ integerFormat.format(serverMean) + " ms (" + percentFormat.format(serverPercent)
			+ "%)";
	final String domProcessingLabel = I18N.getString("DOM_processing") + " : "
			+ integerFormat.format(domProcessingMean) + " ms ("
			+ percentFormat.format(domProcessingPercent) + "%)";
	final String pageRenderingLabel = I18N.getString("Page_rendering") + " : "
			+ integerFormat.format(pageRenderingMean) + " ms ("
			+ percentFormat.format(pageRenderingPercent) + "%)";
	rumDataPanel.add(new JLabel(networkLabel));
	rumDataPanel.add(new JLabel(serverLabel));
	rumDataPanel.add(new JLabel(domProcessingLabel));
	rumDataPanel.add(new JLabel(pageRenderingLabel));
	return rumDataPanel;
}
 
Example #24
Source File: VectorContentViewer.java    From SVG-Android with Apache License 2.0 5 votes vote down vote up
VectorContentViewer(String stringData, OnTextWatcher textWatcher) {
    this.mTextWatcher = textWatcher;
    setLayout(new GridLayout(1, 1));
    mTextArea = new JTextArea();
    mTextArea.setText(stringData);
    mTextArea.getDocument().addDocumentListener(this);
    mTextArea.setMinimumSize(new Dimension(200, 200));
    add(mTextArea);
}
 
Example #25
Source File: CardTest.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
CardPanel(ActionListener actionListener) {
    listener = actionListener;
    setLayout(new CardLayout());
    add("one", create(new FlowLayout()));
    add("two", create(new BorderLayout()));
    add("three", create(new GridLayout(2, 2)));
    add("four", create(new BorderLayout(10, 10)));
    add("five", create(new FlowLayout(FlowLayout.LEFT, 10, 10)));
    add("six", create(new GridLayout(2, 2, 10, 10)));
}
 
Example #26
Source File: CardTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
CardPanel(ActionListener actionListener) {
    listener = actionListener;
    setLayout(new CardLayout());
    add("one", create(new FlowLayout()));
    add("two", create(new BorderLayout()));
    add("three", create(new GridLayout(2, 2)));
    add("four", create(new BorderLayout(10, 10)));
    add("five", create(new FlowLayout(FlowLayout.LEFT, 10, 10)));
    add("six", create(new GridLayout(2, 2, 10, 10)));
}
 
Example #27
Source File: MainPanel.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
private Component createBottom() {
    final JPanel panel = new JPanel(new GridLayout(1, 4, 5, 0));
    panel.add(bBack);
    panel.add(bNext);
    panel.add(bCancel);
    panel.add(bFinish);

    final JPanel p = new JPanel(new FlowLayout());

    p.add(panel);

    final JPanel res = new JPanel(new GridBagLayout());
    final GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    final JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
    p1.add(etap);

    c.weightx = 1.0;
    c.gridx = 0;
    c.gridy = 0;

    res.add(p1, c);

    c.weightx = 0;
    c.gridx = 1;
    c.gridy = 0;

    res.add(p, c);

    return res;
}
 
Example #28
Source File: FindDialog.java    From FancyBing with GNU General Public License v3.0 5 votes vote down vote up
private JPanel createPanel()
{
    JPanel panel = new JPanel(new GridLayout(0, 1));
    panel.setBorder(GuiUtil.createEmptyBorder());
    JLabel label = new JLabel(i18n("LB_FIND_SEARCH_PATTERN"));
    label.setHorizontalAlignment(SwingConstants.LEFT);
    panel.add(label);
    panel.add(createInputPanel());
    return panel;
}
 
Example #29
Source File: DataChartsViewer.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
ControlPanel( DataChartsViewer dcv )
{
	this.dcv = dcv;

	setLayout( new GridLayout( 0, 1, 0, 0 ) );

	JPanel jp = new JPanel( );
	jp.setLayout( new FlowLayout( FlowLayout.LEFT, 3, 3 ) );

	JLabel choose=new JLabel( "Choose:" );//$NON-NLS-1$
	choose.setDisplayedMnemonic( 'c' );
	jp.add( choose );
	jcbModels = new JComboBox( );

	jcbModels.addItem( "Min Slice" );//$NON-NLS-1$
	jcbModels.addItem( "Multiple Y Axis" );//$NON-NLS-1$
	jcbModels.addItem( "Multiple Y Series" );//$NON-NLS-1$
	jcbModels.addItem( "Big number Y Series" );//$NON-NLS-1$

	jcbModels.setSelectedIndex( 0 );
	choose.setLabelFor( jcbModels );
	jp.add( jcbModels );

	jbUpdate = new JButton( "Update" );//$NON-NLS-1$
	jbUpdate.setMnemonic( 'u' );
	jbUpdate.setToolTipText( "Update" );//$NON-NLS-1$
	jbUpdate.addActionListener( this );
	jp.add( jbUpdate );

	add( jp );
}
 
Example #30
Source File: PaintAll.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(final String[] args) throws Exception {
    //Frame initialisation
    final BufferedImage graphicsProducer =
            new BufferedImage(BufferedImage.TYPE_INT_ARGB, 1, 1);

    final Graphics g = graphicsProducer.getGraphics();

    frame.setLayout(new GridLayout());
    frame.add(buttonStub);
    frame.add(canvasStub);
    frame.add(checkboxStub);
    frame.add(choiceStub);
    frame.add(lwComponentStub);
    frame.add(containerStub);
    frame.add(labelStub);
    frame.add(listStub);
    frame.add(panelStub);
    frame.add(scrollbarStub);
    frame.add(scrollPaneStub);
    frame.add(textAreaStub);
    frame.add(textFieldStub);
    frame.setSize(new Dimension(500, 500));
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    sleep();

    //Check results.
    validation();

    //Reset all flags to 'false'.
    initPaintedFlags();

    //Tested method.
    frame.paintAll(g);
    sleep();

    //Check results.
    validation();
    cleanup();
}