Java Code Examples for java.awt.GridBagLayout

The following are top voted examples for showing how to use java.awt.GridBagLayout. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: jaer   File: JspikeStack.java   Source Code and License 7 votes vote down vote up
/** Start a menu that allows the user to launch a number of demos for the 
 * JSpikeStack package.  To add a new demo to the menu:
 * 1) Add the appropriate element to the "Demos" enumerator (above);
 * 2) Add the button in demoMenu()
 * 3) Connect the enumerator element to the appropriate function in DemoLauncher through the switch statement.
 */
public static void demoMenu()
{
            
    JFrame frm=new JFrame();
    frm.setTitle("JSpikeStack demos");
    Container pane=frm.getContentPane();
    JButton button;
    
    pane.setLayout(new GridBagLayout());
    
    addDemoButton("Network Generation Demo","Read a network From XML and let it generate",Demos.GENERATE,pane);
    addDemoButton("Learning Demo","Read an AER file, initialize a random net, and run STDP learning",Demos.LEARN,pane);
    addDemoButton("Convolution Demo",  "Here we read data from the Silicon retina.  Two output layers respond to vertically and horizontally oriented features.",Demos.CONV,pane);
    addDemoButton("RC Network",  "Takes retina inputs and fires them to a smoothing network.",Demos.RCNET,pane);
    addDemoButton("Retina",  "In this demo we mimic the behaviour of a variety of types of retinal ganglion cell.",Demos.RETINA,pane);
    
    
    frm.setPreferredSize(new Dimension(500,500));
    frm.pack();
    frm.setVisible(true);
    frm.toFront();
    frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
}
 
Example 2
Project: FizeauExperimentSimulation   File: DetectorPanel.java   Source Code and License 7 votes vote down vote up
public DetectorPanel(){
	setLayout(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	setPreferredSize(new Dimension(250,130));
	setBackground(Color.WHITE);

	this.detectorLabel= new JLabel("OBRAZ DETEKTORA");
	c.gridx = 0;
	c.gridy = 0;
	c.anchor=GridBagConstraints.PAGE_START;
	this.detectorLabel.setFont(this.header);
	this.add(this.detectorLabel,c);

	this.detectorImage = new DetectorImage();
	c.gridy = 1;
	c.insets = new Insets(5,0,5,0);
	this.add(this.detectorImage,c);

}
 
Example 3
Project: incubator-netbeans   File: UI.java   Source Code and License 7 votes vote down vote up
public static JPanel createSeparator(String message) {
    JPanel panel = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.anchor = GridBagConstraints.WEST;

    c.insets = new Insets(LARGE_SIZE, 0, LARGE_SIZE, 0);
    panel.add(createLabel(message), c);

    c.weightx = 1.0;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(LARGE_SIZE, LARGE_SIZE, LARGE_SIZE, 0);
    panel.add(new JSeparator(), c);

    return panel;
}
 
Example 4
Project: rapidminer   File: PrintPreviewPanel.java   Source Code and License 7 votes vote down vote up
/**
 * Creates a preview panel for the specified {@link PrintableComponent}.
 *
 * @param comp
 *            the {@link PrintableComponent} the preview panel should be created for.
 */
public PrintPreviewPanel(PrintableComponent comp, PageFormat pageFormat) {
	this.printer = new ComponentPrinter(comp);
	this.cardLayout = new CardLayout();
	this.pageFormat = pageFormat;
	setLayout(cardLayout);

	GridBagConstraints gbc = new GridBagConstraints();
	gbc.weightx = 1;
	gbc.weighty = 1;
	gbc.fill = GridBagConstraints.NONE;
	gbc.anchor = GridBagConstraints.CENTER;

	landscapePanel = new JPanel(new GridBagLayout());
	landscapePreview = new ComponentPreviewPanel(Orientation.LANDSCAPE);
	landscapePanel.add(landscapePreview, gbc);
	add(landscapePanel, Orientation.LANDSCAPE.toString());

	portraitPanel = new JPanel(new GridBagLayout());
	portraitPreview = new ComponentPreviewPanel(Orientation.PORTRAIT);
	portraitPanel.add(portraitPreview, gbc);
	add(portraitPanel, Orientation.PORTRAIT.toString());

	// set page format
	setPageFormat(pageFormat);
}
 
Example 5
Project: cuttlefish   File: DBQueryPanel.java   Source Code and License 6 votes vote down vote up
/**
 * This method initializes this
 */
private void initialize() {
	GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
	gridBagConstraints1.fill = GridBagConstraints.VERTICAL;
	gridBagConstraints1.gridy = 1;
	gridBagConstraints1.weightx = 1.0;
	gridBagConstraints1.insets = new Insets(2, 2, 2, 2);
	gridBagConstraints1.gridx = 0;
	
	GridBagConstraints gridBagConstraints = new GridBagConstraints();
	gridBagConstraints.gridx = 0;
	gridBagConstraints.insets = new Insets(2, 2, 2, 2);
	gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
	gridBagConstraints.gridy = 2;

	GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
	gridBagConstraints2.gridx = 0;
	gridBagConstraints2.insets = new Insets(2, 2, 2, 2);
	gridBagConstraints2.fill = GridBagConstraints.VERTICAL;
	gridBagConstraints2.gridy = 3;

	this.setLayout(new GridBagLayout());
       this.add(getExecuteButton(), gridBagConstraints1);
       this.add(new JLabel("Node query:"), gridBagConstraints);
       this.add(getQueryField(), gridBagConstraints2);
	}
 
Example 6
Project: etomica   File: ViewAlkaneLengthSelection.java   Source Code and License 6 votes vote down vote up
private void addLeftRightComponents(JComponent[] ComponentLeft,
		JComponent[] ComponentRight,
           GridBagLayout gridbag,
           Container container) {
	
		GridBagConstraints c = new GridBagConstraints();
		c.anchor = GridBagConstraints.NORTHEAST;
		int numLabels = ComponentLeft.length;

		for (int i = 0; i < numLabels; i++) {
			c.gridwidth = GridBagConstraints.RELATIVE; //next-to-last
			c.fill = GridBagConstraints.NONE;      //reset to default
			c.weightx = 0.0;   
			c.insets = new Insets(0,10,0,0);//reset to default
			container.add(ComponentLeft[i], c);

			c.gridwidth = GridBagConstraints.REMAINDER;     //end row
			c.fill = GridBagConstraints.HORIZONTAL;
			c.weightx = 0.0;
			c.insets = new Insets(0,10,3,0);
			container.add(ComponentRight[i], c);
		}
}
 
Example 7
Project: incubator-netbeans   File: RSSFeed.java   Source Code and License 6 votes vote down vote up
private JComponent buildContentLoadingLabel() {
    JLabel label = new JLabel( BundleSupport.getLabel( "ContentLoading" ) ); // NOI18N
    label.setHorizontalAlignment( JLabel.CENTER );
    label.setVerticalAlignment( JLabel.CENTER );
    label.setOpaque( false );
    Component header = getContentHeader();
    if( null != header ) {
        JPanel panel = new JPanel( new GridBagLayout() );
        panel.setOpaque( false );
        panel.add( header, new GridBagConstraints(0,0,1,1,1.0,1.0,
            GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) );
        panel.add( label, new GridBagConstraints(0,1,1,1,1.0,1.0,
            GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) );
        panel.setBorder( BorderFactory.createEmptyBorder(40, 0, 40, 0));
        return panel;
    }
    label.setBorder( BorderFactory.createEmptyBorder(40, 0, 40, 0));
    return label;
}
 
Example 8
Project: incubator-netbeans   File: GetStarted.java   Source Code and License 6 votes vote down vote up
private int addLink( int row, DataObject dob ) {
    Action action = extractAction( dob );
    if( null != action ) {
        JPanel panel = new JPanel( new GridBagLayout() );
        panel.setOpaque(false);
        ActionButton lb = new ActionButton( action, Utils.getUrlString( dob ),
                Utils.getColor( COLOR_BIG_BUTTON ), true, dob.getPrimaryFile().getPath() );
        panel.add( lb, new GridBagConstraints(1,0,1,3,1.0,0.0,GridBagConstraints.WEST,GridBagConstraints.HORIZONTAL,new Insets(0,0,0,0),0,0) );
        lb.setFont( GET_STARTED_FONT );
        
        lb.getAccessibleContext().setAccessibleName( lb.getText() );
        lb.getAccessibleContext().setAccessibleDescription( 
                BundleSupport.getAccessibilityDescription( "GettingStarted", lb.getText() ) ); //NOI18N
        add( panel, new GridBagConstraints( 0,row++,1,1,1.0,0.0,
            GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
            new Insets(0,0,3,0), 0, 0 ) );
    }
    return row;
}
 
Example 9
Project: incubator-netbeans   File: GridBagInfoProvider.java   Source Code and License 6 votes vote down vote up
public GridBagInfoProvider(Container container, LayoutSupportManager layoutManager) {
    this.container = container;
    this.layoutManager = layoutManager;
    LayoutManager containerLayout = container.getLayout();
    if (!(containerLayout instanceof GridBagLayout)) {
        throw new IllegalArgumentException();
    }
    try {
        tempXField = GridBagConstraints.class.getDeclaredField("tempX"); // NOI18N
        tempXField.setAccessible(true);
        tempYField = GridBagConstraints.class.getDeclaredField("tempY"); // NOI18N
        tempYField.setAccessible(true);
        tempHeightField = GridBagConstraints.class.getDeclaredField("tempHeight"); // NOI18N
        tempHeightField.setAccessible(true);
        tempWidthField = GridBagConstraints.class.getDeclaredField("tempWidth"); // NOI18N
        tempWidthField.setAccessible(true);
    } catch (NoSuchFieldException nsfex) {
        FormUtils.LOGGER.log(Level.INFO, nsfex.getMessage(), nsfex);
    }
    containerEmphColor = deriveEmphColor(container);
}
 
Example 10
Project: OpenJSharp   File: ServiceDialog.java   Source Code and License 6 votes vote down vote up
public QualityPanel() {
    super();

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

    setLayout(gridbag);
    setBorder(BorderFactory.createTitledBorder(strTitle));

    c.fill = GridBagConstraints.BOTH;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.weighty = 1.0;

    ButtonGroup bg = new ButtonGroup();
    rbDraft = createRadioButton("radiobutton.draftq", this);
    bg.add(rbDraft);
    addToGB(rbDraft, this, gridbag, c);
    rbNormal = createRadioButton("radiobutton.normalq", this);
    rbNormal.setSelected(true);
    bg.add(rbNormal);
    addToGB(rbNormal, this, gridbag, c);
    rbHigh = createRadioButton("radiobutton.highq", this);
    bg.add(rbHigh);
    addToGB(rbHigh, this, gridbag, c);
}
 
Example 11
Project: rapidminer   File: LinkButtonValueCellEditor.java   Source Code and License 6 votes vote down vote up
/**
 * Creates either a {@link LinkLocalButton} or a {@link LinkRemoteButton} that executes the
 * action stored in type.
 *
 * @param type
 *            the type
 */
public LinkButtonValueCellEditor(final ParameterTypeLinkButton type) {
	super(new JTextField());
	this.container = new JPanel(new GridBagLayout());
	this.container.setToolTipText(type.getDescription());

	GridBagConstraints gbc = new GridBagConstraints();

	JComponent linkButton;
	if (type.isLocalAction()) {
		linkButton = new LinkLocalButton(type.getAction());
	} else {
		linkButton = new LinkRemoteButton(type.getAction());
	}
	gbc.gridx += 1;
	gbc.weightx = 1;
	gbc.fill = GridBagConstraints.HORIZONTAL;
	container.add(linkButton, gbc);
}
 
Example 12
Project: jdk8u-jdk   File: ServiceDialog.java   Source Code and License 6 votes vote down vote up
public QualityPanel() {
    super();

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

    setLayout(gridbag);
    setBorder(BorderFactory.createTitledBorder(strTitle));

    c.fill = GridBagConstraints.BOTH;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.weighty = 1.0;

    ButtonGroup bg = new ButtonGroup();
    rbDraft = createRadioButton("radiobutton.draftq", this);
    bg.add(rbDraft);
    addToGB(rbDraft, this, gridbag, c);
    rbNormal = createRadioButton("radiobutton.normalq", this);
    rbNormal.setSelected(true);
    bg.add(rbNormal);
    addToGB(rbNormal, this, gridbag, c);
    rbHigh = createRadioButton("radiobutton.highq", this);
    bg.add(rbHigh);
    addToGB(rbHigh, this, gridbag, c);
}
 
Example 13
Project: SuperMarketManageSystem   File: KuCunPanDian.java   Source Code and License 6 votes vote down vote up
public KuCunPanDian() {
	super();
	setMaximizable(true);
	setIconifiable(true);
	setClosable(true);
	getContentPane().setLayout(new GridBagLayout());
	setTitle("����̵�");
	setBounds(50, 50, 750, 400);

	setupComponet(new JLabel("�� �� Ա��"), 0, 0, 1, 0, false);
	pdy.setFocusable(false);
	pdy.setPreferredSize(new Dimension(120, 21));
	setupComponet(pdy, 1, 0, 1, 0, true);

	setupComponet(new JLabel("�̵�ʱ�䣺"), 2, 0, 1, 0, false);
	pdsj.setFocusable(false);
	pdsj.setText(pdDate.toLocaleString());
	pdsj.setPreferredSize(new Dimension(180, 21));
	setupComponet(pdsj, 3, 0, 1, 1, true);

	setupComponet(new JLabel("Ʒ �� ����"), 4, 0, 1, 0, false);
	pzs.setFocusable(false);
	pzs.setPreferredSize(new Dimension(80, 21));
	setupComponet(pzs, 5, 0, 1, 20, true);

	table = new JTable();
	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	initTable();

	JScrollPane scrollPanel = new JScrollPane(table);
	scrollPanel.setPreferredSize(new Dimension(700, 300));
	setupComponet(scrollPanel, 0, 2, 6, 1, true);
}
 
Example 14
Project: incubator-netbeans   File: SectionSeparator.java   Source Code and License 6 votes vote down vote up
private void initComponents(String text, Font font) {
    setBorder(BorderFactory.createEmptyBorder());
    setLayout(new GridBagLayout());
    setOpaque(false);

    label = new JLabel(text);
    label.setForeground(getForeground());
    if (font != null) label.setFont(font);
    else label.setFont(label.getFont().deriveFont(Font.BOLD));
    GridBagConstraints c1 = new GridBagConstraints();
    c1.weighty = 1d;
    add(label, c1);

    GridBagConstraints c2 = new GridBagConstraints();
    c2.weightx = 1d;
    c2.fill = GridBagConstraints.HORIZONTAL;
    c2.insets = new Insets(0, 4, 0, 0);
    add(new Separator(), c2);
}
 
Example 15
Project: asgdrivestrength   File: DrivestrengthMainWindow.java   Source Code and License 6 votes vote down vote up
public DrivestrengthMainWindow() {
    try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {
    }
    setLayout(new GridBagLayout());
    setTitle("ASGDrivestrength");
    setSize(500, 300);

    JSlider percentageEnergySlider = new JSlider(JSlider.HORIZONTAL,
            0, 100, 0);

    JButton runButton = new JButton("Run");
    add(percentageEnergySlider);
    add(runButton);

    setVisible(true);
}
 
Example 16
Project: incubator-netbeans   File: ViewModelListener.java   Source Code and License 6 votes vote down vote up
ViewModelListener(
    String viewType,
    JComponent view,
    JComponent buttonsPane,
    String propertiesHelpID,
    Image viewIcon
) {
    this.viewType = viewType;
    this.view = view;
    this.buttonsPane = buttonsPane;
    buttonsPane.setLayout(new GridBagLayout());
    this.propertiesHelpID = propertiesHelpID;
    this.viewIcon = viewIcon;
    initView();
    setUp();
}
 
Example 17
Project: openjdk-jdk10   File: ServiceDialog.java   Source Code and License 6 votes vote down vote up
public ChromaticityPanel() {
    super();

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

    setLayout(gridbag);
    setBorder(BorderFactory.createTitledBorder(strTitle));

    c.fill = GridBagConstraints.BOTH;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.weighty = 1.0;

    ButtonGroup bg = new ButtonGroup();
    rbMonochrome = createRadioButton("radiobutton.monochrome", this);
    rbMonochrome.setSelected(true);
    bg.add(rbMonochrome);
    addToGB(rbMonochrome, this, gridbag, c);
    rbColor = createRadioButton("radiobutton.color", this);
    bg.add(rbColor);
    addToGB(rbColor, this, gridbag, c);
}
 
Example 18
Project: incubator-netbeans   File: ProgressPanel.java   Source Code and License 6 votes vote down vote up
/** Creates new form ProgressPanel */
public ProgressPanel() {
    initComponents();
    handle = ProgressHandleFactory.createHandle(
            NbBundle.getMessage(ImportProjectAction.class, "CTL_ProgressDialogTitle")); // NOI18N
    progress = ProgressHandleFactory.createProgressComponent(handle);
    setLayout(new GridBagLayout());
    setPreferredSize(new Dimension(450, 80));
    GridBagConstraints gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new Insets(0, 5, 0, 5);
    add(progress, gridBagConstraints);
}
 
Example 19
Project: AgentWorkbench   File: JadeSetupServices.java   Source Code and License 6 votes vote down vote up
/**
 * This method initializes this
 * @return void
 */
private void initialize() {
	
	GridBagLayout gridBagLayout = new GridBagLayout();
	gridBagLayout.rowWeights = new double[]{0.0};
	gridBagLayout.columnWeights = new double[]{1.0};
	this.setLayout(gridBagLayout);
	this.setSize(950, 500);

	GridBagConstraints gbc_ServiceLists = new GridBagConstraints();
	gbc_ServiceLists.gridx = 0;
	gbc_ServiceLists.fill = GridBagConstraints.BOTH;
	gbc_ServiceLists.insets = new Insets(10, 10, 5, 10);
	gbc_ServiceLists.weightx = 1.0;
	gbc_ServiceLists.weighty = 1.0;
	gbc_ServiceLists.ipadx = 0;
	gbc_ServiceLists.gridy = 0;
	this.add(this.getJPanelServiceLists(), gbc_ServiceLists);
	
}
 
Example 20
Project: AgentWorkbench   File: EnvironmentModel.java   Source Code and License 6 votes vote down vote up
/**
 * Initialize.
 */
private void initialize() {
	GridBagLayout gridBagLayout = new GridBagLayout();
	gridBagLayout.columnWidths = new int[] { 0, 0 };
	gridBagLayout.rowHeights = new int[] { 0, 0, 0 };
	gridBagLayout.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
	gridBagLayout.rowWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
	setLayout(gridBagLayout);
	GridBagConstraints gbc_jPanelSimulationEnvironment = new GridBagConstraints();
	gbc_jPanelSimulationEnvironment.insets = new Insets(10, 10, 0, 0);
	gbc_jPanelSimulationEnvironment.anchor = GridBagConstraints.NORTH;
	gbc_jPanelSimulationEnvironment.fill = GridBagConstraints.HORIZONTAL;
	gbc_jPanelSimulationEnvironment.gridx = 0;
	gbc_jPanelSimulationEnvironment.gridy = 0;
	add(getJPanelSimulationEnvironment(), gbc_jPanelSimulationEnvironment);
	GridBagConstraints gbc_jPanelTimeModelSelection = new GridBagConstraints();
	gbc_jPanelTimeModelSelection.anchor = GridBagConstraints.WEST;
	gbc_jPanelTimeModelSelection.insets = new Insets(10, 10, 0, 0);
	gbc_jPanelTimeModelSelection.fill = GridBagConstraints.VERTICAL;
	gbc_jPanelTimeModelSelection.gridx = 0;
	gbc_jPanelTimeModelSelection.gridy = 1;
	add(getJPanelTimeModelSelection(), gbc_jPanelTimeModelSelection);

}
 
Example 21
Project: AgentWorkbench   File: DynFormText.java   Source Code and License 6 votes vote down vote up
/**
 * This method initializes this
 * @return void
 */
private void initialize() {
	GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
	gridBagConstraints11.gridx = 0;
	gridBagConstraints11.fill = GridBagConstraints.HORIZONTAL;
	gridBagConstraints11.weightx = 1.0;
	gridBagConstraints11.gridy = 1;
	
	GridBagConstraints gridBagConstraints = new GridBagConstraints();
	gridBagConstraints.fill = GridBagConstraints.BOTH;
	gridBagConstraints.weightx = 1.0;
	gridBagConstraints.weighty = 1.0;
	gridBagConstraints.gridwidth = 1;
	
	this.setSize(300, 200);
	this.setLayout(new GridBagLayout());
	this.add(getJScrollPaneTextVersion(), gridBagConstraints);
	this.add(getJPanelBottom(), gridBagConstraints11);
}
 
Example 22
Project: rapidminer   File: AbstractConfigurationPanel.java   Source Code and License 6 votes vote down vote up
protected void addSeperatorToPanel(JPanel addTarget) {
	if (!(addTarget.getLayout() instanceof GridBagLayout)) {
		throw new RuntimeException("JPanel with GridBagLayout is mandatory!");
	}

	JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL);

	GridBagConstraints itemConstraint = new GridBagConstraints();
	itemConstraint.gridx = GridBagConstraints.RELATIVE;
	itemConstraint.weightx = 1.0;
	itemConstraint.gridwidth = GridBagConstraints.REMAINDER; // end row
	itemConstraint.fill = GridBagConstraints.HORIZONTAL;
	itemConstraint.insets = new Insets(0, 5, 5, 5);

	addTarget.add(separator, itemConstraint);
}
 
Example 23
Project: AgentWorkbench   File: JPanelBackgroundSystem.java   Source Code and License 6 votes vote down vote up
/**
 * Initialise.
 */
private void initialize() {
	GridBagLayout gridBagLayout = new GridBagLayout();
	gridBagLayout.columnWidths = new int[]{0, 0};
	gridBagLayout.rowHeights = new int[]{0, 0, 0};
	gridBagLayout.columnWeights = new double[]{0.0, Double.MIN_VALUE};
	gridBagLayout.rowWeights = new double[]{0.0, 0.0, Double.MIN_VALUE};
	setLayout(gridBagLayout);
	
	jLabelServerHeader = new JLabel();
	jLabelServerHeader.setText("Agent.GUI Hintergrundsystem - Konfiguration");
	jLabelServerHeader.setFont(new Font("Dialog", Font.BOLD, 12));
	GridBagConstraints gbc_jLabelServerHeader = new GridBagConstraints();
	gbc_jLabelServerHeader.anchor = GridBagConstraints.WEST;
	gbc_jLabelServerHeader.insets = new Insets(0, 0, 5, 0);
	gbc_jLabelServerHeader.gridx = 0;
	gbc_jLabelServerHeader.gridy = 0;
	this.add(jLabelServerHeader, gbc_jLabelServerHeader);
	GridBagConstraints gbc_jCheckBoxAutoStart = new GridBagConstraints();
	gbc_jCheckBoxAutoStart.anchor = GridBagConstraints.WEST;
	gbc_jCheckBoxAutoStart.gridx = 0;
	gbc_jCheckBoxAutoStart.gridy = 1;
	this.add(getJCheckBoxAutoStart(), gbc_jCheckBoxAutoStart);
	
	
}
 
Example 24
Project: incubator-netbeans   File: NotificationImpl.java   Source Code and License 5 votes vote down vote up
private JComponent createContent(JComponent titleComp, JComponent detailsComp, JComponent priorityComp, JComponent categoryComp, JComponent dateComp) {
    //TODO bold field, add label to timestamp - Created:
    JPanel panel = new JPanel(new GridBagLayout());
    panel.setOpaque(false);
    panel.add(titleComp, new GridBagConstraints(0, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 3, 3), 0, 0));
    if (priorityComp != null) {
        panel.add(priorityComp, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 10, 3, 3), 0, 0));
    }
    if (categoryComp != null) {
        panel.add(categoryComp, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 10, 3, 3), 0, 0));
    }

    panel.add(detailsComp, new GridBagConstraints(0, 2, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(10, 10, 3, 3), 0, 0));

    panel.add(new JLabel(), new GridBagConstraints(2, 3, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));

    if (dateComp != null) {
        panel.add(dateComp, new GridBagConstraints(2, 4, 3, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(3, 3, 3, 3), 0, 0));
    }

    ActionListener actionListener = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            markAsRead(true);
        }
    };
    addActionListener(detailsComp, actionListener);
    return panel;
}
 
Example 25
Project: incubator-netbeans   File: NotificationImpl.java   Source Code and License 5 votes vote down vote up
private JComponent createPriority(Priority p) {
    JPanel panel = new JPanel(new GridBagLayout());
    panel.setOpaque(false);
    panel.add(new JLabel(NbBundle.getMessage(NotificationImpl.class, "LBL_Priority")), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
    panel.add(new JLabel(p.getIcon()), new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    panel.add(new JLabel(p.name()), new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 3, 0, 0), 0, 0));
    panel.add(new JLabel(), new GridBagConstraints(3, 0, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    return panel;
}
 
Example 26
Project: incubator-netbeans   File: NotificationImpl.java   Source Code and License 5 votes vote down vote up
private JComponent createCategory(Category c) {
    JPanel panel = new JPanel(new GridBagLayout());
    panel.setOpaque(false);
    panel.add(new JLabel(NbBundle.getMessage(NotificationImpl.class, "LBL_Category")), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
    panel.add(new JLabel(c.getDisplayName()), new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    panel.add(new JLabel(), new GridBagConstraints(2, 0, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    return panel;
}
 
Example 27
Project: rapidminer   File: AverageVectorViewer.java   Source Code and License 5 votes vote down vote up
public AverageVectorViewer(AverageVector vector, IOContainer container) {
	setLayout(new GridLayout(1, 1));
	this.vector = vector;

	JPanel mainPanel = new JPanel();
	GridBagLayout layout = new GridBagLayout();
	mainPanel.setLayout(layout);
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.BOTH;
	c.insets = new Insets(11, 11, 11, 11);
	c.gridwidth = GridBagConstraints.REMAINDER;
	c.weightx = 1.0d;
	c.weighty = 0.0d;

	JLabel mainLabel = new JLabel("<html><h2>" + getName() + " (" + vector.size() + ")</h2></html>");
	layout.setConstraints(mainLabel, c);
	mainPanel.add(mainLabel);

	for (int i = 0; i < vector.size(); i++) {
		Averagable avg = vector.getAveragable(i);
		Component visualizationComponent = ResultDisplayTools.createVisualizationComponent(avg, container, "Averagable");
		layout.setConstraints(visualizationComponent, c);
		mainPanel.add(visualizationComponent);

	}
	ExtendedJScrollPane scrollPane = new ExtendedJScrollPane(mainPanel);
	scrollPane.setBorder(null);
	add(scrollPane);
}
 
Example 28
Project: incubator-netbeans   File: ContentSection.java   Source Code and License 5 votes vote down vote up
private ContentSection( JComponent content, boolean maxSize, int leftInsets ) {
    super( new GridBagLayout() );
    setOpaque(false);
    this.maxSize = maxSize;
    add( content, new GridBagConstraints(0,1,2,1,1.0,1.0,
            GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,leftInsets,0,0),0,0) );
    
    setBorder( BorderFactory.createEmptyBorder(22,35,15,35) );
}
 
Example 29
Project: incubator-netbeans   File: RSSFeed.java   Source Code and License 5 votes vote down vote up
private JComponent buildProxyPanel() {
    Component header = getContentHeader();
    JPanel panel = new JPanel(new GridBagLayout());
    panel.setOpaque( false );

    int row = 0;
    if( null != header ) {
        panel.add( header,  new GridBagConstraints(0,row++,1,1,1.0,0.0,
                GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) );
    }

    panel.add( new JLabel(BundleSupport.getLabel("ErrCannotConnect")),  // NOI18N
            new GridBagConstraints(0,row++,1,1,0.0,0.0,
            GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) );
    if( showProxyButton ) {
        JButton button = new JButton();
        Mnemonics.setLocalizedText( button, BundleSupport.getLabel( "ProxyConfig" ) );  // NOI18N
        button.setOpaque( false );
        button.addActionListener( new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                HttpProxySettings.getDefault().showConfigurationDialog();
            }
        });
        panel.add( button, new GridBagConstraints(0,row++,1,1,0.0,0.0,
                GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) );
    }
    return panel;
}
 
Example 30
Project: incubator-netbeans   File: RSSFeed.java   Source Code and License 5 votes vote down vote up
private JComponent buildErrorLabel() {
    Component header = getContentHeader();
    JPanel panel = new JPanel(new GridBagLayout());
    panel.setOpaque( false );

    int row = 0;
    if( null != header ) {
        panel.add( header,  new GridBagConstraints(0,row++,1,1,1.0,0.0,
                GridBagConstraints.CENTER,GridBagConstraints.BOTH,new Insets(0,0,0,0),0,0 ) );
    }

    panel.add( new JLabel(BundleSupport.getLabel("ErrLoadingFeed")),  // NOI18N
            new GridBagConstraints(0,row++,1,1,0.0,0.0,
            GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) );
    JButton button = new JButton();
    Mnemonics.setLocalizedText( button, BundleSupport.getLabel( "Reload" ) );  // NOI18N
    button.setOpaque( false );
    button.addActionListener( new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            lastReload = 0;
            reload();
        }
    });
    panel.add( button, new GridBagConstraints(0,row++,1,1,0.0,0.0,
            GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(5,10,10,5),0,0 ) );
    return panel;
}
 
Example 31
Project: openjdk-jdk10   File: ServiceDialog.java   Source Code and License 5 votes vote down vote up
public MediaPanel() {
    super();

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

    setLayout(gridbag);
    setBorder(BorderFactory.createTitledBorder(strTitle));

    cbSize = new JComboBox<>();
    cbSource = new JComboBox<>();

    c.fill = GridBagConstraints.BOTH;
    c.insets = compInsets;
    c.weighty = 1.0;

    c.weightx = 0.0;
    lblSize = new JLabel(getMsg("label.size"), JLabel.TRAILING);
    lblSize.setDisplayedMnemonic(getMnemonic("label.size"));
    lblSize.setLabelFor(cbSize);
    addToGB(lblSize, this, gridbag, c);
    c.weightx = 1.0;
    c.gridwidth = GridBagConstraints.REMAINDER;
    addToGB(cbSize, this, gridbag, c);

    c.weightx = 0.0;
    c.gridwidth = 1;
    lblSource = new JLabel(getMsg("label.source"), JLabel.TRAILING);
    lblSource.setDisplayedMnemonic(getMnemonic("label.source"));
    lblSource.setLabelFor(cbSource);
    addToGB(lblSource, this, gridbag, c);
    c.gridwidth = GridBagConstraints.REMAINDER;
    addToGB(cbSource, this, gridbag, c);
}
 
Example 32
Project: ObsidianSuite   File: ImportModelFrame.java   Source Code and License 5 votes vote down vote up
private JPanel createTabulaPanel() {
	JPanel tabulaPanel = new JPanel();

	tabulaModelBox = new JComboBox<ComboBoxFileItem>(getComboBoxFileItems());
	tabulaModelBox.setPrototypeDisplayValue(new ComboBoxFileItem(new File("ModelSomethingOrOther.obm")));
	tabulaModelBox.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			modelFile = ((ComboBoxFileItem) tabulaModelBox.getSelectedItem()).file; 
			refresh();				
		}
	});

	JLabel label = new JLabel("Tabula Model:");
	label.setPreferredSize(new Dimension(150, 25));

	tabulaPanel.setLayout(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.weightx = 1;
	c.insets = new Insets(5, 5, 5, 5);

	tabulaPanel.add(label, c);

	c.gridx = 1;
	tabulaPanel.add(tabulaModelBox, c);
	return tabulaPanel;
}
 
Example 33
Project: incubator-netbeans   File: BottomBar.java   Source Code and License 5 votes vote down vote up
public BottomBar() {
    super( new GridBagLayout() );
    setOpaque(true);
    setBackground( Utils.getBottomBarColor() );
    
    add( Logo.createOracleLogo(), new GridBagConstraints(0,0,1,1,0.0,0.0,
            GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(0,12,0,5),0,0 ) );
    
    add( new JLabel(), new GridBagConstraints(1,0,1,1,1.0,0.0,
            GridBagConstraints.CENTER,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0 ) );
    
    add( Logo.createJavaLogo(), new GridBagConstraints(4,0,1,1,0.0,0.0,
            GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(5,5,5,12),0,0 ) );
}
 
Example 34
Project: LogisticApp   File: DiretaPanelBuilder.java   Source Code and License 5 votes vote down vote up
private void initializeLayout() {
	GridBagLayout gridBagLayout = new GridBagLayout();
	gridBagLayout.columnWidths = new int[] { 0, 0, 70, 130, 0, 0, 0 };
	gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0 };
	gridBagLayout.columnWeights = new double[] { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, Double.MIN_VALUE };
	gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
			0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
	this.panel.setLayout(gridBagLayout);
}
 
Example 35
Project: jdk8u-jdk   File: JDK8048887.java   Source Code and License 5 votes vote down vote up
public TestDialog() {
    JPanel panel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    for (int i=0; i < Xs.length; i++) {
        gbc.gridx = Xs[i];
        gbc.gridy = 100 - gbc.gridx;
        panel.add(new MyComponent(), gbc);
    }
    getRootPane().getContentPane().add(panel);
    pack();
}
 
Example 36
Project: incubator-netbeans   File: PlatformsCustomizer.java   Source Code and License 5 votes vote down vote up
private static void addComponent (Container container, Component component) {
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = c.gridy = GridBagConstraints.RELATIVE;
    c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.weightx = c.weighty = 1.0;
    ((GridBagLayout)container.getLayout()).setConstraints (component,c);
    container.add (component);
}
 
Example 37
Project: BrainControl   File: TestingTab.java   Source Code and License 5 votes vote down vote up
public TestingTab(CAEAgent agent, PlayerPanel view) {
	super(new GridBagLayout());
	this.cmdsHistory =  PlayHook.voiceControl.getCommandsHistory();
	
	this.cmdsHistoryTable = new JTable(cmdsHistory);
	this.cmdsHistoryTable.getTableHeader().setVisible(true);
	this.cmdsHistoryTable.getTableHeader().setReorderingAllowed(false);
	this.cmdsHistoryTable.getModel().addTableModelListener(view);
}
 
Example 38
Project: incubator-netbeans   File: NbiTextDialog.java   Source Code and License 5 votes vote down vote up
private void initComponents() {
    setLayout(new GridBagLayout());
    
    textPane = new NbiTextPane();
    
    textPanel = new NbiPanel();
    textPanel.setLayout(new BorderLayout());
    textPanel.add(textPane, BorderLayout.CENTER);
    
    textScrollPane = new NbiScrollPane(textPanel);
    textScrollPane.setViewportBorder(new EmptyBorder(new Insets(5, 5, 5, 5)));
    textScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    
    add(textScrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(11, 11, 11, 11), 0, 0));
}
 
Example 39
Project: incubator-netbeans   File: Attribute.java   Source Code and License 5 votes vote down vote up
private JPanel getTitleSection() {
        JPanel panel = new JPanel(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();

        setLabelPanel(panel, c);
        setHeaderPanel(panel, c);
        setFooterPanel(panel, c);
        setMacroPanel(panel, c);
//      panel.setBorder(new javax.swing.border.LineBorder(java.awt.Color.red));

        return panel;
    }
 
Example 40
Project: incubator-netbeans   File: Attribute.java   Source Code and License 5 votes vote down vote up
private JPanel getTextSection() {
    JPanel panel = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.anchor = GridBagConstraints.WEST;

    createTopTextPanel(panel, c);
    createBottomTextPanel(panel, c);

    return panel;
}
 
Example 41
Project: JuggleMasterPro   File: PrintAppearanceJPanel.java   Source Code and License 5 votes vote down vote up
public PrintAppearanceJPanel(PrintJDialog objPprintJDialog, ControlJFrame objPcontrolJFrame) {

		this.objGprintChromaticitySubJPanel = new PrintChromaticitySubJPanel(objPprintJDialog, objPcontrolJFrame);
		this.objGprintQualitySubJPanel = new PrintQualitySubJPanel(objPprintJDialog);
		this.objGprintSidesSubJPanel = new PrintSidesSubJPanel(objPprintJDialog, objPcontrolJFrame);
		this.objGprintJobAttributesSubJPanel = new PrintJobAttributesSubJPanel(objPprintJDialog);

		this.setOpaque(true);
		this.setLayout(new GridBagLayout());
		final ExtendedGridBagConstraints objLextendedGridBagConstraints =
																			new ExtendedGridBagConstraints(	GridBagConstraints.RELATIVE,
																											0,
																											1,
																											1,
																											GridBagConstraints.CENTER,
																											6,
																											6,
																											6,
																											6,
																											GridBagConstraints.BOTH,
																											1.0F,
																											1.0F);

		this.add(this.objGprintChromaticitySubJPanel, objLextendedGridBagConstraints);
		this.add(this.objGprintQualitySubJPanel, objLextendedGridBagConstraints);
		objLextendedGridBagConstraints.setGridLocation(GridBagConstraints.RELATIVE, 1);
		this.add(this.objGprintSidesSubJPanel, objLextendedGridBagConstraints);
		this.add(this.objGprintJobAttributesSubJPanel, objLextendedGridBagConstraints);
	}
 
Example 42
Project: gate-core   File: AnnotationStack.java   Source Code and License 5 votes vote down vote up
void init() {
  setLayout(new GridBagLayout());
  setOpaque(true);
  setBackground(Color.WHITE);
  stackRows = new ArrayList<StackRow>();
  textMouseListener = new StackMouseListener();
  headerMouseListener = new StackMouseListener();
  annotationMouseListener = new StackMouseListener();
}
 
Example 43
Project: incubator-netbeans   File: PalettePanel.java   Source Code and License 5 votes vote down vote up
private void prepareSearchPanel() {
    if( searchpanel == null ) {
        searchpanel = new SearchPanel();

        JLabel lbl = new JLabel(NbBundle.getMessage(PalettePanel.class, "LBL_QUICKSEARCH")); //NOI18N
        searchpanel.setLayout(new GridBagLayout());
        searchpanel.add(lbl, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,5), 0, 0));
        searchpanel.add(searchTextField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,5), 0, 0));
        searchpanel.add(new JLabel(), new GridBagConstraints(2, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,0,0,0), 0, 0));
        lbl.setLabelFor(searchTextField);
        searchTextField.setColumns(10);
        searchTextField.setMaximumSize(searchTextField.getPreferredSize());
        searchTextField.putClientProperty("JTextField.variant", "search"); //NOI18N
        lbl.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));

        JButton btnCancel = new JButton(ImageUtilities.loadImageIcon("org/netbeans/modules/palette/resources/cancel.png", true));
        btnCancel.setBorder(BorderFactory.createEmptyBorder());
        btnCancel.setBorderPainted(false);
        btnCancel.setOpaque(false);
        btnCancel.setContentAreaFilled(false);
        searchpanel.add(btnCancel, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0,0,0,5), 0, 0));
        btnCancel.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                removeSearchField();
            }
        });
    }
}
 
Example 44
Project: jmt   File: JSimProblemsWindow.java   Source Code and License 5 votes vote down vote up
private void addComponent(Component component, GridBagLayout gbl, GridBagConstraints gbc, int row, int column, int width, int heigth) {
	Container c = this.getContentPane();

	gbc.gridx = column;
	gbc.gridy = row;

	gbc.gridwidth = width;
	gbc.gridheight = heigth;

	gbl.setConstraints(component, gbc);
	c.add(component);
}
 
Example 45
Project: org.alloytools.alloy   File: OurUtil.java   Source Code and License 5 votes vote down vote up
public static JPanel makeGrid(int cols, GridBagConstraints template, Container... containers) {
	JPanel ans = new JPanel(new GridBagLayout());
	int i = -1;
	for (Container container : containers) {
		for (Component comp : container.getComponents()) {
			i++;
			GridBagConstraints c = (GridBagConstraints) template.clone();
			c.gridx = i % cols;
			c.gridy = i / cols;
			ans.add(comp, c);
		}
	}
	return ans;
}
 
Example 46
Project: incubator-netbeans   File: PropertiesOpen.java   Source Code and License 5 votes vote down vote up
/** Inits the subcomponents. Sets layout for this top component and adds {@code BundleEditPanel} to it. 
 * @see BundleEditPanel */
private void initComponents() {
    GridBagLayout gridbag = new GridBagLayout();
    setLayout(gridbag);

    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1.0;
    c.weighty = 1.0;
    c.gridwidth = GridBagConstraints.REMAINDER;
    JPanel panel = new BundleEditPanel(bundleStructure, new PropertiesTableModel(bundleStructure));
    gridbag.setConstraints(panel, c);
    add(panel);
}
 
Example 47
Project: incubator-netbeans   File: ServerManagerPanel.java   Source Code and License 5 votes vote down vote up
private static void addComponent(Container container, Component component) {
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = c.gridy = GridBagConstraints.RELATIVE;
    c.gridheight = c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.weightx = c.weighty = 1.0;
    ((GridBagLayout)container.getLayout()).setConstraints(component,c);
    container.add(component);
}
 
Example 48
Project: SkinFixer   File: SkinInstaller.java   Source Code and License 5 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
    String action = e.getActionCommand();

    if(action.equals(VERSION_CHOOSER)) {
        File mc = new File(minecraftPath.getText());
        File versions = new File(mc, "versions");

        JDialog dialog = new JDialog();

        dialog.setTitle("Select a Version");
        dialog.setLayout(new GridBagLayout());

        GridBagConstraints c = new GridBagConstraints();
        c.insets = new Insets(5, 5, 5, 5);
        c.fill = GridBagConstraints.HORIZONTAL;
        c.gridx = 0;

        version = new JComboBox();
        for(File f : versions.listFiles()) {
            if(f.isDirectory()) version.addItem(f.getName());
        }
        dialog.add(version, c);

        JButton install = new JButton("Install");
        install.setActionCommand(INSTALL);
        install.addActionListener(this);
        dialog.add(install, c);

        Dimension d = dialog.getPreferredSize();
        dialog.setSize(new Dimension(d.width + 50, d.height + 50));
        dialog.setLocationRelativeTo(this);

        dialog.setVisible(true);
    } else if(action.equals(INSTALL)) {
        //TODO
    }
}
 
Example 49
Project: incubator-netbeans   File: JSLineBreakpointCustomizer.java   Source Code and License 5 votes vote down vote up
private void init(JSLineBreakpoint b) {
    c = getCustomizerComponent(b);
    setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    add(c, gbc);
}
 
Example 50
Project: Proj4   File: JSpaceSettlersInfoPanel.java   Source Code and License 5 votes vote down vote up
public JSpaceSettlersInfoPanel(SpaceSettlersSimulator simulator) {
	super();

       //setPreferredSize(new Dimension(100, 800));
	
	constraints = new GridBagConstraints();
	//constraints.fill = GridBagConstraints.BOTH;
	constraints.insets = new Insets(10, 10, 10, 10);
	setLayout(new GridBagLayout());

	constraints.gridx = 0;
	constraints.gridy = 0;
	globalInfo = new GlobalInfoPanel();
	add(globalInfo, constraints);
       teamComponents = new HashMap<String, TeamInfoPanel>();
       
	// populate the team hash map the first time it is called with a valid simulator object
	int teamNum = 1;
       for (Team team : simulator.getTeams()) {
       	TeamInfoPanel tInfo = new TeamInfoPanel(team);
       	teamComponents.put(team.getTeamName(), tInfo);
   		constraints.gridx = 0;
   		constraints.gridy = teamNum;
           constraints.gridwidth = GridBagConstraints.REMAINDER;
           add(tInfo, constraints);
           teamNum++;
       }
       
       objectPanel = new ObjectInfoPanel();
	constraints.gridx = 0;
	constraints.gridy = simulator.getTeams().size() + 1;
       constraints.gridwidth = GridBagConstraints.REMAINDER;
       add(objectPanel, constraints);
}
 
Example 51
Project: GIFKR   File: SettingsPanel.java   Source Code and License 5 votes vote down vote up
public SettingsPanel(MainPanel r) {
	this.mainP = r;

	initializeComponents();
	addActionListeners();
	
	setSource(mainP.getAnimation().getSource());

	setOpaque(false);
	setLayout(new GridBagLayout());

	GridBagConstraints gbc	= new GridBagConstraints();
	gbc.weightx				= 1;
	gbc.weighty				= 0;
	gbc.gridx				= 0;
	gbc.gridy				= 0;
	gbc.gridwidth			= 1;
	gbc.anchor 				= GridBagConstraints.CENTER;
	gbc.fill 				= GridBagConstraints.BOTH;

	add(gifFrameWrap, gbc);
	gbc.gridy++;

	add(animateBox, gbc);
	gbc.gridy++;

	add(animationControlP, gbc);
	gbc.gridy++;

	add(channelBox, gbc);
	gbc.gridy++;

	gbc.weighty = 1;

	add(cardPanel, gbc);
	gbc.gridy++;
	gbc.weighty = 0;

	add(saveButton, gbc);
}
 
Example 52
Project: incubator-netbeans   File: ResolveDeclarationsPanel.java   Source Code and License 5 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    contentPanel = new javax.swing.JPanel();

    setLayout(new java.awt.BorderLayout());

    contentPanel.setLayout(new java.awt.GridBagLayout());
    add(contentPanel, java.awt.BorderLayout.CENTER);
}
 
Example 53
Project: JuggleMasterPro   File: FiltersJDialog.java   Source Code and License 5 votes vote down vote up
final private JPanel doAddButtons() {

		final JPanel objLjPanel = new JPanel(new GridBagLayout());
		objLjPanel.setOpaque(true);
		final ExtendedGridBagConstraints objLextendedGridBagConstraints =
																			new ExtendedGridBagConstraints(	0,
																											GridBagConstraints.RELATIVE,
																											1,
																											1,
																											GridBagConstraints.CENTER,
																											7,
																											7,
																											0,
																											0,
																											GridBagConstraints.HORIZONTAL,
																											1.0F,
																											0.0F);
		objLjPanel.add(this.objGactivateJButton, objLextendedGridBagConstraints);
		objLjPanel.add(this.objGdeactivateJButton, objLextendedGridBagConstraints);
		objLjPanel.add(this.objGclearJButton, objLextendedGridBagConstraints);
		objLjPanel.add(this.objGcloseJButton, objLextendedGridBagConstraints);
		return objLjPanel;
	}
 
Example 54
Project: incubator-netbeans   File: AdditionalWizardPanel.java   Source Code and License 5 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    sourceLabel = new javax.swing.JLabel();
    sourceCombo = new javax.swing.JComboBox();

    setLayout(new java.awt.GridBagLayout());

    org.openide.awt.Mnemonics.setLocalizedText(sourceLabel, NbBundle.getBundle(AdditionalWizardPanel.class).getString("LBL_Source")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    add(sourceLabel, gridBagConstraints);

    sourceCombo.setRenderer(new SourceWizardPanel.DataObjectListCellRenderer());
    sourceCombo.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            sourceComboActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 11, 0, 0);
    add(sourceCombo, gridBagConstraints);
}
 
Example 55
Project: incubator-netbeans   File: ProgressPanel.java   Source Code and License 5 votes vote down vote up
/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    setPreferredSize(new java.awt.Dimension(450, 80));
    setLayout(new java.awt.GridBagLayout());
    getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(ProgressPanel.class, "ACSD_ProgressPanel_NA")); // NOI18N
    getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ProgressPanel.class, "ACSD_ProgressPanel_NA")); // NOI18N
}
 
Example 56
Project: openjdk-jdk10   File: ServiceDialog.java   Source Code and License 5 votes vote down vote up
public PageSetupPanel() {
    super();

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

    setLayout(gridbag);

    c.fill = GridBagConstraints.BOTH;
    c.insets = panelInsets;
    c.weightx = 1.0;
    c.weighty = 1.0;

    c.gridwidth = GridBagConstraints.REMAINDER;
    pnlMedia = new MediaPanel();
    addToGB(pnlMedia, this, gridbag, c);

    pnlOrientation = new OrientationPanel();
    c.gridwidth = GridBagConstraints.RELATIVE;
    addToGB(pnlOrientation, this, gridbag, c);

    pnlMargins = new MarginsPanel();
    pnlOrientation.addOrientationListener(pnlMargins);
    pnlMedia.addMediaListener(pnlMargins);
    c.gridwidth = GridBagConstraints.REMAINDER;
    addToGB(pnlMargins, this, gridbag, c);
}
 
Example 57
Project: LogisticApp   File: RotaFrame.java   Source Code and License 5 votes vote down vote up
private void initializePanels() {
	this.panelFirst = new JPanel();
	this.panelFirst.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
	GridBagConstraints gbc_panel = new GridBagConstraints();
	gbc_panel.insets = new Insets(0, 0, 5, 0);
	gbc_panel.fill = GridBagConstraints.BOTH;
	gbc_panel.gridx = 0;
	gbc_panel.gridy = 0;
	this.contentPane.add(this.panelFirst, gbc_panel);

	GridBagLayout gbl_panel = new GridBagLayout();
	gbl_panel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
	gbl_panel.rowHeights = new int[] { 0, 0, 0, 0, 0 };
	gbl_panel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
			0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
	gbl_panel.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
	this.panelFirst.setLayout(gbl_panel);

	this.panelSecond = new JPanel();
	GridBagConstraints gbc_panel_1 = new GridBagConstraints();
	gbc_panel_1.insets = new Insets(0, 0, 5, 0);
	gbc_panel_1.fill = GridBagConstraints.BOTH;
	gbc_panel_1.gridx = 0;
	gbc_panel_1.gridy = 1;
	this.contentPane.add(this.panelSecond, gbc_panel_1);

	GridBagLayout gbl_panel_1 = new GridBagLayout();
	gbl_panel_1.columnWidths = new int[] { 0, 0, 0, 0, 0 };
	gbl_panel_1.rowHeights = new int[] { 0, 0, 0, 0, 0, 0 };
	gbl_panel_1.columnWeights = new double[] { 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE };
	gbl_panel_1.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
	this.panelSecond.setLayout(gbl_panel_1);

	this.panelRota = new JPanel();
	GridBagConstraints gbc_panel_2 = new GridBagConstraints();
	gbc_panel_2.fill = GridBagConstraints.BOTH;
	gbc_panel_2.gridx = 0;
	gbc_panel_2.gridy = 2;
	contentPane.add(panelRota, gbc_panel_2);
}
 
Example 58
Project: ObsidianSuite   File: ImportModelFrame.java   Source Code and License 5 votes vote down vote up
private FileSelectionPanel(String title, final FileNameExtensionFilter filter) {
	setLayout(new GridBagLayout());

	titleLabel = new JLabel(title);
	titleLabel.setHorizontalAlignment(JLabel.HORIZONTAL);

	locationLabel = new JLabel("No location set");
	locationLabel.setPreferredSize(new Dimension(150, 25));

	chooseFileButton = new JButton("Choose File");
	chooseFileButton.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			try {
				targetFile = FileChooser.loadImportFile(frame, filter);
				String path = targetFile.getAbsolutePath();
				locationLabel.setText(path);
				locationLabel.setToolTipText(path);
				modelFile = targetFile;
				refresh();
			} catch (FileNotChosenException e1) {
			}
		}
	});

	GridBagConstraints c = new GridBagConstraints();
	c.insets = new Insets(5, 5, 5, 5);

	c.gridwidth = 2;
	add(titleLabel, c);

	c.gridwidth = 1;
	c.gridy = 1;
	add(locationLabel, c);

	c.gridx = 1;
	add(chooseFileButton, c);
}
 
Example 59
Project: rapidminer   File: PerspectivesPanelBar.java   Source Code and License 5 votes vote down vote up
private PerspectivesPanelBar(Perspectives perspectives) {
	setLayout(new GridBagLayout());
	setOpaque(false);

	GridBagConstraints gbc = new GridBagConstraints();
	gbc.insets = new Insets(1, 10, 2, 0);

	JToolBar workspaceToolBar = perspectives.getWorkspaceToolBar();
	workspaceToolBar.setBackground(getBackgroundColor());
	add(workspaceToolBar, gbc);
}
 
Example 60
Project: SE2017-Team2   File: GUIPane.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
public GUIPane() {
	// super(new GridLayout(1, 2));
	super(new GridBagLayout());

	GridBagConstraints c = new GridBagConstraints();
	simulation = false;
	actPane = new ActionPane();

	// JScrollPane scroller = new JScrollPane(actPane);
	// this.add(actPane, c);
	// this.add(scroller, BorderLayout.WEST);

	tabbedPane = new JTabbedPane();
	// c.fill = GridBagConstraints.HORIZONTAL;
	c.fill = GridBagConstraints.BOTH;
	c.weightx = 0.5;
	c.weighty = 0.5;
	c.gridx = 1;
	c.gridy = 0;
	c.gridwidth = 1;

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

	// The following line enables to use scrolling tabs.
	tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
	tabbedPane.addChangeListener(this);

	this.setSize(this.getWidth(), tabbedPane.getHeight());

}