Java Code Examples for javax.swing.JPanel

The following are top voted examples for showing how to use javax.swing.JPanel. 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: VASSAL-src   File: TranslateWindow.java   View source code 7 votes vote down vote up
protected void initComponents() {
  setTitle("Translate " + VASSAL.configure.ConfigureTree.getConfigureName((Configurable) target));
  JPanel mainPanel = new JPanel(new BorderLayout());
  /*
   * Place Language selector above Tree and Keys
   */
  mainPanel.add(getHeaderPanel(), BorderLayout.PAGE_START);
  mainPanel.add(buildMainPanel(), BorderLayout.CENTER);
  mainPanel.add(getButtonPanel(), BorderLayout.PAGE_END);
  add(mainPanel);
  pack();
  setLocationRelativeTo(getParent());
  setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
  addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
      cancel();
    }
  });
}
 
Example 2
Project: SE2Project   File: VormerkUI.java   View source code 6 votes vote down vote up
/**
 * Initialisiert die Elemente der Benutzungsoberfläche.
 * 
 * @param kundenauflisterPanel Das UI-Panel des Kundenauflisters.
 * @param medienauflisterPanel Das UI-Panel des Medienauflisters.
 * @param mediendetailAnzeigerPanel Das UI-Panel des Mediendetailanzeigers.
 * 
 * @require (kundenauflisterPanel != null)
 * @require (medienauflisterPanel != null)
 * @require (kundendetailAnzeigerPanel != null)
 * @require (mediendetailAnzeigerPanel != null)
 */
public VormerkUI(JPanel kundenauflisterPanel, JPanel medienauflisterPanel,
        JPanel kundendetailAnzeigerPanel, JPanel mediendetailAnzeigerPanel)
{
    assert kundenauflisterPanel != null : "Vorbedingung verletzt: (kundenauflisterPanel != null)";
    assert medienauflisterPanel != null : "Vorbedingung verletzt: (medienauflisterPanel != null)";
    assert kundendetailAnzeigerPanel != null : "Vorbedingung verletzt: (kundendetailAnzeigerPanel != null)";
    assert mediendetailAnzeigerPanel != null : "Vorbedingung verletzt: (mediendetailAnzeigerPanel != null)";

    _kundenauflisterPanel = kundenauflisterPanel;
    _medienauflisterPanel = medienauflisterPanel;
    _mediendetailAnzeigerPanel = mediendetailAnzeigerPanel;
    _kundendetailAnzeigerPanel = kundendetailAnzeigerPanel;

    erzeugeHauptPanel();
    erzeugeAuflisterPanel();
    erzeugeAusleihePanel();
}
 
Example 3
Project: ramus   File: DFDSRoleOptionsDialog.java   View source code 6 votes vote down vote up
@Override
protected Component createFirstTab(JTabbedPane pane) {
    sectorRowsEditor = new SectorRowsEditor(dataPlugin, framework,
            framework.getAccessRules());
    sectorNameEditor = new SectorNameEditor(dataPlugin, framework,
            framework.getAccessRules()) {
        @Override
        protected void createReplacementPanel(JPanel ignoreMe) {
        }

        @Override
        public Stream getStream() {
            return sectorRowsEditor.getStream();
        }
    };
    sectorNameEditor.box.setVisible(false);
    sectorRowsEditor.setSectorNameEditor(sectorNameEditor);
    pane.addTab(ResourceLoader.getString("name"), sectorRowsEditor);
    return sectorNameEditor;
}
 
Example 4
Project: rapidminer   File: EULADialog.java   View source code 6 votes vote down vote up
/**
 * Creates the content panel consisting of a scrollable text area to display the EULA text and a
 * check box to accept it.
 */
private JComponent makeContentPanel() {
	JPanel panel = new JPanel();
	panel.setLayout(new BorderLayout());

	// add text area with scroll pane
	panel.add(this.scrollPane, BorderLayout.CENTER);
	// scroll to tohe top of the document
	SwingUtilities.invokeLater(new Runnable() {

		@Override
		public void run() {
			scrollPane.getVerticalScrollBar().setValue(0);
		}
	});

	// add check box to enable accept button
	panel.add(this.acceptCheckBox, BorderLayout.SOUTH);

	return panel;
}
 
Example 5
Project: thornsec-core   File: FullFrame.java   View source code 6 votes vote down vote up
private JPanel getOutputPanel(JTextArea area) {
	JPanel panel = getNewPanel();

	JScrollPane areapane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

	GridBagConstraints g = new GridBagConstraints();

	areapane.setViewportView(area);

	g.gridx = 0;
	g.gridy = 1;
	g.weightx = 1;
	g.weighty = 1;
	g.fill = GridBagConstraints.BOTH;
	panel.add(areapane, g);
	
	return panel;
}
 
Example 6
Project: knime-activelearning   File: ToggleButtonList.java   View source code 6 votes vote down vote up
private JToggleButton addButton(final String value) {
    final int numBtns = m_buttons.size();

    if (numBtns >= (m_maxRows * m_panels.size())) {
        // create a new Panel
        final JPanel panel = new JPanel(new GridLayout(m_maxRows, 1));

        this.add(panel);

        m_panels.add(panel);
        m_lastPanel = panel;
    }
    // createButton and add this as itemListener
    final JToggleButton btn = new CustomToggleButton(value);
    btn.addActionListener(this);

    if (value.equals(ClassModel.NO_CLASS)) {
        btn.setText(m_defaultText);
    }

    m_lastPanel.add(btn); // add it to the last Panel

    m_buttons.add(btn);
    return btn;
}
 
Example 7
Project: mqtt-jmeter   File: CommonConnUI.java   View source code 6 votes vote down vote up
public JPanel createConnPanel() {
	JPanel con = new HorizontalPanel();
	
	JPanel connPanel = new HorizontalPanel();
	connPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "MQTT connection"));
	connPanel.add(serverAddr);
	connPanel.add(serverPort);
	connPanel.add(mqttVersion);
	connPanel.add(connShared);
	
	JPanel timeoutPannel = new HorizontalPanel();
	timeoutPannel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Timeout"));
	timeoutPannel.add(timeout);

	con.add(connPanel);
	con.add(timeoutPannel);
	return con;
}
 
Example 8
Project: incubator-netbeans   File: GenericToolbar.java   View source code 6 votes vote down vote up
public void addSeparator() {
    if (!UIUtils.isMetalLookAndFeel()) {
        super.addSeparator();
    } else {
        final JSeparator separator = new JSeparator(JSeparator.VERTICAL);
        final int WDTH = separator.getPreferredSize().width;
        final Dimension SIZE = new Dimension(new JToolBar.Separator().getSeparatorSize().width, 12);
        JPanel panel = new JPanel(null) {
            public Dimension getPreferredSize() { return SIZE; }
            public Dimension getMaximumSize() { return SIZE; }
            public Dimension getMinimumSize() { return SIZE; }

            public void doLayout() {
                int x = (getWidth() - WDTH) / 2;
                int y = (getHeight()- SIZE.height) / 2;
                separator.setBounds(x, y, WDTH, SIZE.height);
            }
        };
        panel.setOpaque(false);
        panel.add(separator);
        super.add(panel);
    }
}
 
Example 9
Project: xdman   File: YoutubeGrabberDlg.java   View source code 6 votes vote down vote up
JPanel createP3() {
	p3 = new JPanel(new BorderLayout());
	model = new DefaultListModel();
	list = new JList(model);
	list.setCellRenderer(new YTListRenderer());
	p3.add(new JScrollPane(list));
	Box box = Box.createHorizontalBox();
	box.add(Box.createHorizontalGlue());
	btnDwnld = new JButton("Download");
	btnDwnld.addActionListener(this);
	btnCancel = new JButton("Close");
	btnCancel.addActionListener(this);
	box.add(btnDwnld);
	box.add(Box.createHorizontalStrut(10));
	box.add(btnCancel);
	btnCancel.setPreferredSize(btnDwnld.getPreferredSize());
	box.add(Box.createHorizontalStrut(10));
	box.add(Box.createRigidArea(new Dimension(0, 40)));
	p3.add(box, BorderLayout.SOUTH);

	box.setOpaque(true);
	box.setBackground(StaticResource.titleColor);
	return p3;
}
 
Example 10
Project: rapidminer   File: ChartConfigurationPanel.java   View source code 6 votes vote down vote up
@Override
public void print(Graphics pg) {

	JPanel printPanel = new JPanel() {

		private static final long serialVersionUID = 7315234075649335574L;

		@Override
		public void paintComponent(Graphics g) {
			Graphics2D g2 = (Graphics2D) g;
			plotEngine.getChartPanel().print(g2);
		}
	};
	Insets insets = plotEngine.getChartPanel().getInsets();
	int w = plotEngine.getChartPanel().getWidth() - insets.left - insets.right;
	int h = plotEngine.getChartPanel().getHeight() - insets.top - insets.bottom;
	printPanel.setSize(new Dimension(w, h));

	printPanel.print(pg);
}
 
Example 11
Project: FreeCol   File: TerrainDetailPanel.java   View source code 6 votes vote down vote up
private void addProduction(JPanel panel, Stream<AbstractGoods> production) {
    // Positive production only
    List<AbstractGoods> pro = transform(production, AbstractGoods::isPositive);
    String tag = null;
    switch (pro.size()) {
    case 0:
        panel.add(new JLabel(), "wrap");
        break;
    case 1:
        tag = "span";
        break;
    default:
        tag = "span, split " + pro.size();
        break;
    }
    for (AbstractGoods ag : pro) {
        panel.add(getGoodsButton(ag.getType(), ag.getAmount()), tag);
        tag = null;
    }
}
 
Example 12
Project: Equella   File: ExceptionDialog.java   View source code 6 votes vote down vote up
private JComponent createNiceMessages()
{
	JLabel heading = new JLabel("<html><font size=+1>" + title + "</font></html>");

	JTextArea body = new JTextArea(message);
	body.setHighlighter(null);
	body.setEditable(false);
	body.setFocusable(false);
	body.setOpaque(false);
	body.setBorder(null);
	body.setLineWrap(true);
	body.setWrapStyleWord(true);
	body.setFont(heading.getFont());

	final int[] rows = new int[]{heading.getPreferredSize().height, TableLayout.FILL};
	final int[] columns = new int[]{TableLayout.FILL};

	TableLayout layout = new TableLayout(rows, columns, 5, 5);
	JPanel all = new JPanel(layout);
	all.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

	all.add(heading, new Rectangle(0, 0, 1, 1));
	all.add(body, new Rectangle(0, 1, 1, 1));

	return all;
}
 
Example 13
Project: Equella   File: KeyResourcesTab.java   View source code 6 votes vote down vote up
@SuppressWarnings("nls")
private JComponent setupResultsNavigator()
{
	countLabel = new JLabel();
	firstPage = new JButton("<<");
	prevPage = new JButton("<");
	nextPage = new JButton(">");
	lastPage = new JButton(">>");

	firstPage.setEnabled(false);
	prevPage.setEnabled(false);
	nextPage.setEnabled(false);
	lastPage.setEnabled(false);

	firstPage.addActionListener(this);
	prevPage.addActionListener(this);
	nextPage.addActionListener(this);
	lastPage.addActionListener(this);

	final int width1 = firstPage.getPreferredSize().width;
	final int height = firstPage.getPreferredSize().height;
	final int[] rows = {height,};
	final int[] cols = {TableLayout.FILL, width1, width1, width1, width1,};

	JPanel all = new JPanel(new TableLayout(rows, cols));

	all.add(countLabel, new Rectangle(0, 0, 1, 1));
	all.add(firstPage, new Rectangle(1, 0, 1, 1));
	all.add(prevPage, new Rectangle(2, 0, 1, 1));
	all.add(nextPage, new Rectangle(3, 0, 1, 1));
	all.add(lastPage, new Rectangle(4, 0, 1, 1));

	return all;
}
 
Example 14
Project: GIFKR   File: GraphInterpolator.java   View source code 6 votes vote down vote up
private void initializeComponents() {
	
	graphPanel = new JPanel() {
		private static final long serialVersionUID = -1105560304467720245L;
		
		@Override 
		public Dimension getPreferredSize() {
			return getGraphSize();
		}
		
		@Override 
		public void paintComponent(Graphics g) {
			super.paintComponent(g);
			paintGraph((Graphics2D) g, graphPanel.getWidth(), graphPanel.getHeight());
		}
	};
	graphPanel.setFocusable(true);
}
 
Example 15
Project: Vanilla-Injection   File: DisplayWindow.java   View source code 6 votes vote down vote up
private void updateContentPane() {
    JPanel infoPanel = new JPanel();
    infoPanel.setBackground(BACKGROUND);

    JLabel label = new JLabel("Currently running module '" + moduleName + "' on world '" + world.getName() + "'");
    label.setForeground(FOREGROUND);
    label.setBorder(new EmptyBorder(25, 25, 25, 25));
    infoPanel.add(label);

    this.setContentPane(infoPanel);
    this.revalidate();
    this.repaint();
    this.setVisible(false);
    this.pack();
    this.setVisible(true);
}
 
Example 16
Project: QN-ACTR-Release   File: EpochPanel.java   View source code 6 votes vote down vote up
private void initComponents() {
	this.setLayout(new BorderLayout());
	epochs = new JSpinner(new SpinnerNumberModel(10, 10, 50, 1));
	JPanel epochOption = new JPanel(new BorderLayout());
	JPanel flowTemp = new JPanel(new FlowLayout(FlowLayout.LEFT));
	epochs.setPreferredSize(new Dimension(70, 40));
	epochs.setFont(new Font(epochs.getFont().getName(), epochs.getFont().getStyle(), epochs.getFont().getSize() + 4));
	flowTemp.add(new JLabel("<html><body><h3>Select the maximum number of epochs: </h3></body></html> "));
	flowTemp.add(epochs);
	JButton setEpoch = new JButton(this.setEpoch);
	setEpoch.setPreferredSize(new Dimension(85, 35));
	flowTemp.add(setEpoch);
	epochOption.add(flowTemp, BorderLayout.CENTER);
	//JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
	//btnPanel.add(setEpoch);
	//epochOption.add(btnPanel,BorderLayout.SOUTH);
	this.add(epochOption, BorderLayout.NORTH);
}
 
Example 17
Project: jaer   File: FiringModelMap.java   View source code 6 votes vote down vote up
protected void fillPanel() {
//			removeAll();
			JPanel dummyPanel = new JPanel();
			dummyPanel.setLayout(new BorderLayout());
			dummyPanel.add(new JLabel("   "), BorderLayout.WEST);
			kernelPanel = new JPanel();
			dummyPanel.add(kernelPanel,BorderLayout.CENTER);
			kernelPanel.setLayout(new GridBagLayout());
			CollapsablePanel collapsablePanel = new CollapsablePanel("Input kernels",dummyPanel);
            for (SignalTransformationKernel stk : inputKernels) {
				ParameterBrowserPanel newPanel = new ParameterBrowserPanel(stk);
				newPanel.toggleSelection();
				kernelPanel.add(newPanel, gbcKernel);
				panels.add(newPanel);
				gbcKernel.gridy++;
				panelCounter++;
			}
            collapsablePanel.toggleSelection();
            add(collapsablePanel, gbc);
            gbc.gridy++;
	        JFrame frame = (JFrame) SwingUtilities.getRoot(this);
	        if (frame != null)
	        	frame.pack();
		}
 
Example 18
Project: Community_Tieba-Data-Analyzer   File: Util.java   View source code 5 votes vote down vote up
public static void errMessage(String s){
	JFrame frame = new JFrame("Error Message");
	JLabel label = new JLabel(s);
	JPanel panel = new JPanel();
	frame.getContentPane().add(panel);
	panel.add(label);
	frame.setVisible(true);
	frame.setSize(s.length() * 7, 100);
	frame.setLocation(Config.getIns().getWindowXLocation(), Config.getIns().getWindowYLocation());
	frame.setResizable(true);
	frame.setDefaultCloseOperation(3);
}
 
Example 19
Project: Bachelor-Thesis   File: NodeChooser.java   View source code 5 votes vote down vote up
/**
 * Initializes the node chooser panels
 */
private void init() {
	nodesPanel = new JPanel();
	chooserPanel = new JPanel();
	
	this.setLayout(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.anchor = GridBagConstraints.FIRST_LINE_START;
	
	nodesPanel.setLayout(new BoxLayout(nodesPanel,BoxLayout.Y_AXIS));
	nodesPanel.setBorder(BorderFactory.createTitledBorder(getBorder(),
			"Nodes"));
	
	if (nodes.size() > MAX_NODE_COUNT) {
		String[] groupNames = new String[(nodes.size()-1)/MAX_NODE_COUNT+1];
		int last = 0;
		for (int i=0, n=nodes.size(); i <= (n-1) / MAX_NODE_COUNT; i++) {
			int next = MAX_NODE_COUNT * (i+1) - 1;
			if (next > n) {
				next = n-1;
			}
			groupNames[i] = (last + "..." + next);
			last = next + 1;
		}
		groupChooser = new JComboBox(groupNames);
		groupChooser.addActionListener(this);
		chooserPanel.add(groupChooser);
	}
	
	setNodes(0);
	c.gridy = 0;
	this.add(chooserPanel, c);
	c.gridy = 1;
	this.add(nodesPanel, c);
}
 
Example 20
Project: JuggleMasterPro   File: FiltersJDialog.java   View source code 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 21
Project: cuttlefish   File: ShowLayouts.java   View source code 5 votes vote down vote up
public static void main(String[] args)
{
    JPanel jp = getGraphPanel();

    JFrame jf = new JFrame();
    jf.getContentPane().add(jp);
    jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    jf.pack();
    jf.setVisible(true);
}
 
Example 22
Project: the-one-mdonnyk   File: NodeChooser.java   View source code 5 votes vote down vote up
/**
 * Initializes the node chooser panels
 */
private void init() {
	nodesPanel = new JPanel();
	chooserPanel = new JPanel();
	
	this.setLayout(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.anchor = GridBagConstraints.FIRST_LINE_START;
	
	nodesPanel.setLayout(new BoxLayout(nodesPanel,BoxLayout.Y_AXIS));
	nodesPanel.setBorder(BorderFactory.createTitledBorder(getBorder(),
			"Nodes"));
	
	if (nodes.size() > MAX_NODE_COUNT) {
		String[] groupNames = new String[(nodes.size()-1)/MAX_NODE_COUNT+1];
		int last = 0;
		for (int i=0, n=nodes.size(); i <= (n-1) / MAX_NODE_COUNT; i++) {
			int next = MAX_NODE_COUNT * (i+1) - 1;
			if (next > n) {
				next = n-1;
			}
			groupNames[i] = (last + "..." + next);
			last = next + 1;
		}
		groupChooser = new JComboBox(groupNames);
		groupChooser.addActionListener(this);
		chooserPanel.add(groupChooser);
	}
	
	setNodes(0);
	c.gridy = 0;
	this.add(chooserPanel, c);
	c.gridy = 1;
	this.add(nodesPanel, c);
}
 
Example 23
Project: code-sentinel   File: BaseDialogGUI.java   View source code 5 votes vote down vote up
protected void createField(String label, JComponent tf1, JComponent tf2, String tooltip) {
    JLabel jl = new JLabel(label+": ");
    jl.setToolTipText(tooltip);
    tf1.setToolTipText(tooltip);
    pLabels.add(jl);
    JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
    p.add(tf1);
    p.add(tf2);
    pFields.add(p);
}
 
Example 24
Project: ramus   File: Preferences.java   View source code 5 votes vote down vote up
private void init() {
    double[][] size = {
            {5, TableLayout.MINIMUM, 5, TableLayout.FILL},
            {5, TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5,
                    TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5}};
    this.setTitle(getString("Preferences.Title"));

    JPanel panel = new JPanel(new TableLayout(size));

    JLabel path = new JLabel(getString("Base.Location"));

    panel.add(path, "1, 1");
    panel.add(createLocationSector(), "3, 1");

    panel.add(new JLabel(getString("WebPort")), "1, 3");
    panel.add(webPort, "3, 3");

    //panel.add(new JLabel(), "1, 5");
    panel.add(canUndoRedo, "3, 5");

    //panel.add(new JLabel(), "1, 7");
    panel.add(autostart, "3, 7");

    setMainPane(panel);
    pack();
    centerDialog();
    setResizable(false);
}
 
Example 25
Project: rapidminer   File: SVDModelCumulativePlotRenderer.java   View source code 5 votes vote down vote up
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	JPanel panel = new JPanel(new BorderLayout());
	JPanel innerPanel = new JPanel(new BorderLayout());
	innerPanel.add(getPlotter(renderable).getPlotter());
	innerPanel.setBorder(BorderFactory.createMatteBorder(10, 10, 5, 5, Colors.WHITE));
	panel.add(innerPanel, BorderLayout.CENTER);

	return panel;
}
 
Example 26
Project: Equella   File: FilterList.java   View source code 5 votes vote down vote up
protected JPanel createTop()
{
	filter = new JTextField();
	filter.addActionListener(this);

	button = new JButton("Search");
	button.addActionListener(this);

	JPanel all = new JPanel(new BorderLayout(5, 5));
	all.add(filter, BorderLayout.CENTER);
	all.add(button, BorderLayout.EAST);

	return all;
}
 
Example 27
Project: alevin-svn2   File: MultiAlgoScenarioWizard.java   View source code 5 votes vote down vote up
/**
 * @return a {@link JPanel} with {@link JButton}s to manipulate the network
 *         table: Move up, move down, add, remove.
 */
private JPanel createButtons() {
	JPanel bpanel = new JPanel();
	bpanel.setLayout(new BoxLayout(bpanel, BoxLayout.PAGE_AXIS));

	ActionListener listener = new ButtonHandler();
	JButton[] jbuttons = new JButton[4];
	String[] buttons = {
			UP_LBL,		UP_TIP, 	UP_ACTN,
			DOWN_LBL,	DOWN_TIP,	DOWN_ACTN,
			ADD_LBL,	ADD_TIP,	ADD_ACTN,
			REMOVE_LBL,	REMOVE_TIP,	REMOVE_ACTN
	};

	for (int i = 0; i < jbuttons.length; i++) {
		JButton button = new JButton();

		button.setText(buttons[i*3]);
		button.setToolTipText(buttons[i*3+1]);
		button.setActionCommand(buttons[i*3+2]);

		button.addActionListener(listener);
		button.setMaximumSize(new Dimension(
				Short.MAX_VALUE, button.getPreferredSize().height));

		bpanel.add(button);
		jbuttons[i] = button;

		if (i != jbuttons.length - 1) {
			bpanel.add(Box.createVerticalStrut(PADDING));
		}
	}

	this.moveUp = jbuttons[0];
	this.moveDown = jbuttons[1];
	this.add = jbuttons[2];
	this.remove = jbuttons[3];

	return bpanel;
}
 
Example 28
Project: jmeter-prometheus-plugin   File: PrometheusListenerGui.java   View source code 5 votes vote down vote up
protected JPanel createAssertionClassDropDown(){
	JPanel panel = new JPanel(new BorderLayout(5, 0));
	JLabel label = new JLabel("Assertion Type:");
	
	this.assertionComboBox = new JComboBox<>(availableAssertionClasses);
	
	panel.add(label, BorderLayout.WEST);
	panel.add(this.assertionComboBox, BorderLayout.CENTER);
	
	return panel;
}
 
Example 29
Project: Cognizant-Intelligent-Test-Scripter   File: ImageGallery.java   View source code 5 votes vote down vote up
/**
 * clear the thumb panels to free the memory
 */
private void clearThumbs() {
    thumbPanel.removeAll();
    for (JPanel l : thumbList) {
        l = null;
    }
    thumbList.clear();
}
 
Example 30
Project: incubator-netbeans   File: JWSCustomizerPanel.java   View source code 5 votes vote down vote up
private void appletParamsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_appletParamsButtonActionPerformed

    List<Map<String,String>> origProps = jwsProps.getAppletParamsProperties();
    List<Map<String,String>> props = copyList(origProps);
    TableModel appletParamsTableModel = new JWSProjectProperties.PropertiesTableModel(props, JWSProjectProperties.appletParamsSuffixes, appletParamsColumnNames);
    JPanel panel = new AppletParametersPanel((PropertiesTableModel) appletParamsTableModel, jwsProps.appletWidthDocument, jwsProps.appletHeightDocument);
    DialogDescriptor dialogDesc = new DialogDescriptor(panel, NbBundle.getMessage(JWSCustomizerPanel.class, "TITLE_AppletParameters"), true, null); //NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDesc);
    dialog.setVisible(true);
    if (dialogDesc.getValue() == DialogDescriptor.OK_OPTION) {
        jwsProps.setAppletParamsProperties(props);
    }
    dialog.dispose();

}
 
Example 31
Project: jaer   File: SampleProb.java   View source code 5 votes vote down vote up
@Override
public JPanel buildControlPanel() {
	final JPanel panel = new JPanel();
	panel.setLayout(new BorderLayout());
	final JComponent c = new SampleProbControlPanel(SampleProb.this);
	c.setPreferredSize(new Dimension(1000, 800));
	panel.add(new JScrollPane(c), BorderLayout.CENTER);
	return panel;
}
 
Example 32
Project: QN-ACTR-Release   File: LDEditingWindow.java   View source code 5 votes vote down vote up
/**
 * @return the button bar
 */
JPanel makeButtons() {
	JPanel res = new JPanel();
	JButton commit = new JButton(LD_COMMIT);
	help.addHelp(commit, "Closes the LD editor saving changes");
	res.add(commit);
	JButton cancel = new JButton(LD_CANCEL);
	help.addHelp(cancel, "Closes the LD editor discarding all changes");
	res.add(cancel);
	JButton help_b = new JButton(LD_HELP);
	help.addHelp(help_b, "Shows help for the LD editor");
	res.add(help_b);
	return res;
}
 
Example 33
Project: SE2Project   File: VormerkUI.java   View source code 5 votes vote down vote up
/**
 * Erzeugt das Anzeige-Panel, in dem die ausgewählte Medien und der
 * ausgewählte kunde angezeigt werden.
 */
private void erzeugeAnzeigerPanel()
{
    _anzeigerPanel = new JPanel();
    _ausleihePanel.add(_anzeigerPanel, BorderLayout.CENTER);
    _anzeigerPanel.setLayout(new BorderLayout());
    setNoSize(_anzeigerPanel);
    _anzeigerPanel.setBackground(UIConstants.BACKGROUND_COLOR);
    _anzeigerPanel.add(_mediendetailAnzeigerPanel, BorderLayout.CENTER);
    _anzeigerPanel.add(_kundendetailAnzeigerPanel, BorderLayout.NORTH);
}
 
Example 34
Project: cuttlefish   File: CuttlefishPanel.java   View source code 5 votes vote down vote up
/**
 * This method initializes layoutPanel	
 * 	
 * @return javax.swing.JPanel	
 */
private JPanel getLayoutPanel() {
	if (layoutPanel == null) {
		layoutPanel = new LayoutPanel(this);	
	}
	return layoutPanel;
}
 
Example 35
Project: LogisticApp   File: CadastroFrame.java   View source code 5 votes vote down vote up
private void initializeContentPane(){
	this.contentPane = new JPanel();
	this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	this.setContentPane(contentPane);
	GridBagLayout gbl_contentPane = new GridBagLayout();
	gbl_contentPane.columnWidths = new int[]{262, 0};
	gbl_contentPane.rowHeights = new int[]{72, 72, 0};
	gbl_contentPane.columnWeights = new double[]{0.0, Double.MIN_VALUE};
	gbl_contentPane.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
	contentPane.setLayout(gbl_contentPane);
}
 
Example 36
Project: TsrPlugin   File: TsrPlugin.java   View source code 5 votes vote down vote up
@Override
public SettingsTab getSettingsTab() {              
    SettingsTab st = new SettingsTab() {            
        
        @Override
        public JPanel createSettingsPanel() {                
            ret = new Config();
            String urlMessage = mLocalizer.msg( "urlMessage" ,"TVStreamRecord URL and Port (e.g. http://0.0.0.0:8030)" );
            String url = mSettings.getProperty("URL");
            ret.setLabel(urlMessage);
            ret.setURL(url);
            return ret;
        }

        @Override
        public void saveSettings() {
            if (ret!=null) {
                mSettings.setProperty("URL", ret.getURL());                
            }
        }

        @Override
        public Icon getIcon() {
            ImageIcon icon = createImageIcon("img/tvstreamrecord.png");
            return icon;
        }

        @Override
        public String getTitle() {
            return "TvStreamRecord plugin";
        }
    }; 
    return st;
}
 
Example 37
Project: ZXSprite   File: ZXSpriteFrame.java   View source code 5 votes vote down vote up
private JPanel createOptionPanel() {
  JPanel p = new JPanel(new FlowLayout());
  JLabel widthLabel = new JLabel("Width");
  JLabel heightLabel = new JLabel("Height");
  JLabel framesLabel = new JLabel("Num Frames");
  p.add(widthLabel);
  p.add(width);
  p.add(heightLabel);
  p.add(height);
  p.add(framesLabel);
  p.add(frames);
  return p;
}
 
Example 38
Project: smile_1.5.0_java7   File: PCADemo.java   View source code 5 votes vote down vote up
@Override
public JComponent learn() {
    double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
    String[] names = dataset[datasetIndex].toArray(new String[dataset[datasetIndex].size()]);
    if (names[0] == null) {
        names = null;
    }
    boolean cor = corBox.getSelectedIndex() != 0;

    long clock = System.currentTimeMillis();
    PCA pca = new PCA(data, cor);
    System.out.format("Learn PCA from %d samples in %dms\n", data.length, System.currentTimeMillis()-clock);

    JPanel pane = new JPanel(new GridLayout(1, 2));
    PlotCanvas scree = PlotCanvas.screeplot(pca);
    scree.setTitle("Variance");
    pane.add(scree);

    pca.setProjection(3);
    double[][] y = pca.project(data);

    PlotCanvas plot = new PlotCanvas(Math.colMin(y), Math.colMax(y));
    if (names != null) {
        plot.points(y, names);
    } else if (dataset[datasetIndex].responseAttribute() != null) {
        int[] labels = dataset[datasetIndex].toArray(new int[dataset[datasetIndex].size()]);
        for (int i = 0; i < y.length; i++) {
            plot.point(pointLegend, Palette.COLORS[labels[i]], y[i]);
        }
    } else {
        plot.points(y, pointLegend);
    }

    plot.setTitle("Scatter Plot");
    pane.add(plot);
    return pane;
}
 
Example 39
Project: OpenJSharp   File: FileChooserDemo.java   View source code 5 votes vote down vote up
@SuppressWarnings("LeakingThisInConstructor")
WizardDialog(JFrame frame, boolean modal) {
    super(frame, "Embedded JFileChooser Demo", modal);

    cardLayout = new CardLayout();
    cardPanel = new JPanel(cardLayout);
    getContentPane().add(cardPanel, BorderLayout.CENTER);

    messageLabel = new JLabel("", JLabel.CENTER);
    cardPanel.add(chooser, "fileChooser");
    cardPanel.add(messageLabel, "label");
    cardLayout.show(cardPanel, "fileChooser");
    chooser.addActionListener(this);

    JPanel buttonPanel = new JPanel();
    backButton = new JButton("< Back");
    nextButton = new JButton("Next >");
    closeButton = new JButton("Close");

    buttonPanel.add(backButton);
    buttonPanel.add(nextButton);
    buttonPanel.add(closeButton);

    getContentPane().add(buttonPanel, BorderLayout.SOUTH);

    backButton.setEnabled(false);
    getRootPane().setDefaultButton(nextButton);

    backButton.addActionListener(this);
    nextButton.addActionListener(this);
    closeButton.addActionListener(this);

    pack();
    setLocationRelativeTo(frame);
}
 
Example 40
Project: fuck_zookeeper   File: NodeViewerMetaData.java   View source code 5 votes vote down vote up
/**
* 
*/
  public NodeViewerMetaData() {
      this.setLayout(new BorderLayout());
      this.metaDataPanel = new JPanel();
      this.metaDataPanel.setBackground(Color.WHITE);
      JScrollPane scroller = new JScrollPane(this.metaDataPanel);
      this.add(scroller, BorderLayout.CENTER);
  }