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: FizeauExperimentSimulation   File: DetectorPanel.java   View source code 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 2
Project: incubator-netbeans   File: UI.java   View source code 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 3
Project: rapidminer   File: PrintPreviewPanel.java   View source code 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 4
Project: cuttlefish   File: DBQueryPanel.java   View source code 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 5
Project: etomica   File: ViewAlkaneLengthSelection.java   View source code 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 6
Project: incubator-netbeans   File: RSSFeed.java   View source code 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 7
Project: jaer   File: JspikeStack.java   View source code 6 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 8
Project: incubator-netbeans   File: GetStarted.java   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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;
}