Java Code Examples for java.awt.BorderLayout

The following are top voted examples for showing how to use java.awt.BorderLayout. 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: JavaGraph   File: CheckboxTree.java   View source code 6 votes vote down vote up
/**
 * Empty constructor with the correct visibility.
 * @param tree the enclosing checkbox tree
 */
CellRenderer(CheckboxTree tree) {
    this.tree = tree;
    this.jLabel = new DefaultTreeCellRenderer();
    this.jLabel.setOpenIcon(null);
    this.jLabel.setLeafIcon(null);
    this.jLabel.setClosedIcon(null);
    this.jLabel.setBorder(INSET_BORDER);
    this.checkbox = new JCheckBox();
    this.checkbox.setOpaque(false);
    setLayout(new BorderLayout());
    add(this.jLabel, BorderLayout.CENTER);
    add(this.checkbox, CheckboxTree.CHECKBOX_ORIENTATION);
    setBorder(new EmptyBorder(0, 2, 0, 0));
    setComponentOrientation(this.tree.getComponentOrientation());
    setOpaque(false);
}
 
Example 2
Project: SER316-Dresden   File: DailyItemsPanel.java   View source code 6 votes vote down vote up
void toggleButton_actionPerformed(ActionEvent e) {
    if (expanded) {
        expanded = false;
        toggleButton.setIcon(expIcon);
        controlPanel.remove(toggleToolBar);
        controlPanel.add(toggleToolBar, BorderLayout.EAST);
        splitPane.setDividerLocation((int) controlPanel.getMinimumSize().getWidth());

    }
    else {
        expanded = true;
        toggleButton.setIcon(collIcon);
        controlPanel.remove(toggleToolBar);
        controlPanel.add(toggleToolBar, BorderLayout.SOUTH);
        splitPane.setDividerLocation((int) controlPanel.getPreferredSize().getWidth());
    }
}
 
Example 3
Project: se459_team9_trivia_game   File: InfoPage.java   View source code 6 votes vote down vote up
/**
 * Create the application.
 */
public InfoPage() {
	setBounds(100, 100, 450, 300);		
	getContentPane().setLayout(new BorderLayout());
	contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
	getContentPane().add(contentPanel, BorderLayout.CENTER);
	contentPanel.setLayout(null);
	{
		JLabel lblInstructions = new JLabel("INFORMATION");
		lblInstructions.setFont(new Font("Lucida Grande", Font.BOLD, 40));
		lblInstructions.setHorizontalAlignment(SwingConstants.CENTER);
		lblInstructions.setBounds(70, 6, 325, 48);
		contentPanel.add(lblInstructions);
	}
	
	JTextArea txtrTest = new JTextArea();
	txtrTest.setText("Rule 1:\n\nRule 2:\n\nRule 3:\n\nRule 4:\n\nRule 5:\n\nRule 6:\n\nRule 7:\n……..");
	txtrTest.setBounds(17, 52, 415, 181);
	txtrTest.setEditable(false);
	txtrTest.setAutoscrolls(true);
	
	
	contentPanel.add(txtrTest);
}
 
Example 4
Project: dracoon-dropzone   File: Dropzone.java   View source code 6 votes vote down vote up
/**
 * Show password dialog if enabled
 */
private String showPasswordDialog() {
	JPanel panel = new JPanel(new BorderLayout());
	JPasswordField pf = new JPasswordField();
	panel.setBorder(new EmptyBorder(0, 10, 0, 10));
	panel.add(pf, BorderLayout.NORTH);
	JFrame frame = new JFrame();
	frame.setAlwaysOnTop(true);
	pf.requestFocus();

	int option = JOptionPane.showConfirmDialog(frame, panel, I18n.get("main.start.sharelinkpwd"),
			JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
	frame.dispose();
	if (option == JOptionPane.OK_OPTION) {
		return new String(pf.getPassword());
	} else {
		return null;
	}
}
 
Example 5
Project: incubator-netbeans   File: ChoosingDriverUI.java   View source code 6 votes vote down vote up
/** Creates new form ChoosingDriverUI */
public ChoosingDriverUI(ChoosingDriverPanel panel, JDBCDriver driver, AddConnectionWizard wizard) {
    this.drv = driver;
    this.wp = panel;
    this.wizard = wizard;
    initComponents();
    DatabaseExplorerInternalUIs.connect(cbDrivers, JDBCDriverManager.getDefault(), false);
    if (drv == null) {
        cbDrivers.setSelectedIndex(0);
    } else {
        cbDrivers.setSelectedItem(drv);
    }
    customizeDriverPanel = new AddDriverDialog(drv, this, wizard);
    pInter.add(customizeDriverPanel, BorderLayout.CENTER);
    actionListener = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            updateState();
        }
    };
}
 
Example 6
Project: QN-ACTR-Release   File: ClusterPanel.java   View source code 6 votes vote down vote up
public void valueChanged(ListSelectionEvent e) {
	if (!e.getValueIsAdjusting()) {
		switch (clustList.getSelectedIndex()) {
			case 0:
				optClustering.removeAll();
				optClustering.add(new KMeansOptPanel(ClusterPanel.this, new loadListener(), model), BorderLayout.CENTER);
				optClustering.revalidate();
				optClustering.repaint();
				if (session.getListOfClustering().size() == 0) {
					canGoOn = false;
				}
				break;
			case 1:
				optClustering.removeAll();
				optClustering.add(new FuzzyOptPanel(ClusterPanel.this, new loadListener(), model), BorderLayout.CENTER);
				optClustering.revalidate();
				optClustering.repaint();
				if (session.getListOfClustering().size() == 0) {
					canGoOn = false;
				}
				break;
			default:
				clustList.setSelectedIndex(0);
		}
	}
}
 
Example 7
Project: incubator-netbeans   File: AbstractXMLNavigatorContent.java   View source code 6 votes vote down vote up
public void showError(final String message) {
    if (!SwingUtilities.isEventDispatchThread()) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                showError(message);
            }
        });
        return;
    }
    removeAll();
    msgLabel.setIcon(null);
    msgLabel.setForeground(Color.GRAY);
    msgLabel.setText(NbBundle.getMessage(AbstractXMLNavigatorContent.class, message));
    msgLabel.setHorizontalAlignment(SwingConstants.CENTER);
    add(emptyPanel, BorderLayout.CENTER);
    revalidate();
    repaint();
}
 
Example 8
Project: GameOfSet   File: MainFrame.java   View source code 6 votes vote down vote up
public MainFrame(Deck deck) {
    super("Game of Set");
    this.cardsPanel = new CardsPanel(this);
    this.infoPanel = new InfoPanel(this);
    this.setLayout(new BorderLayout());
    this.deck = deck;
    this.setSize(600, 780);
    this.setResizable(false);
    this.setLocationRelativeTo(null);
    this.add(cardsPanel, BorderLayout.CENTER);
    this.add(infoPanel, BorderLayout.SOUTH);
    this.setVisible(true);
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    this.setBoard = new SetBoard(deck);
    this.setFinder = new SetFinder(setBoard.getFlippedCards());

    if (noPossibleSets()) {
        flipThreeMoreCards();
    }
    updatePanels();
}
 
Example 9
Project: rapidminer   File: ResultTab.java   View source code 6 votes vote down vote up
public ResultTab(String id) {
	setLayout(new BorderLayout());
	this.id = id;
	this.dockKey = new DockKey(id, "Result " + id);
	this.dockKey.setDockGroup(MainFrame.DOCK_GROUP_RESULTS);
	this.dockKey.setName(id);
	this.dockKey.setFloatEnabled(true);
	this.dockKey.setIconDisplayed(true);
	DockableActionCustomizer customizer = new DockableActionCustomizer() {

		@Override
		public void visitTabSelectorPopUp(JPopupMenu popUpMenu, Dockable dockable) {
			popUpMenu.add(new JMenuItem(new StoreInRepositoryAction(resultObject)));
			popUpMenu.add(new JMenuItem(new CloseAllResultsAction(RapidMinerGUI.getMainFrame())));
		}
	};
	customizer.setTabSelectorPopUpCustomizer(true); // enable tabbed dock custom popup menu
	// entries
	this.dockKey.setActionCustomizer(customizer);
	label = makeStandbyLabel();
	add(label, BorderLayout.CENTER);
}
 
Example 10
Project: freecol   File: MapEditorTransformPanel.java   View source code 6 votes vote down vote up
/**
 * Creates a panel to choose a map transform.
 *
 * @param freeColClient The {@code FreeColClient} for the game.
 */
public MapEditorTransformPanel(FreeColClient freeColClient) {
    super(freeColClient, new BorderLayout());

    nativeNation = first(getSpecification().getIndianNations());

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

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

    JScrollPane sl = new JScrollPane(listPanel,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    sl.getViewport().setOpaque(false);
    add(sl);
}
 
Example 11
Project: JITRAX   File: TablesManagerWindow.java   View source code 6 votes vote down vote up
private void buildLeftPanel() {
	String[] tablesNames = getDatabase().getTablesNames();
	setCommonBorder(getLeftPanel(), "Tables");
	
	tablesViewer = new TablesViewer(database.getTables());
	JScrollPane tablesListSP = new JScrollPane(tablesViewer);
	tablesListSP.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
	
	// Listeners for the graphic tables
	setPanelsListeners();
	
	JPanel buttonsPanel = new JPanel();
	buttonsPanel.add(getAddTableButton());
	buttonsPanel.add(getEraseTableButton());
	buttonsPanel.add(getModifyTableButton());
	getLeftPanel().add(buttonsPanel, BorderLayout.SOUTH);
	getLeftPanel().add(tablesListSP, BorderLayout.CENTER);
}
 
Example 12
Project: hy.common.ui   File: JTimePanelTest.java   View source code 6 votes vote down vote up
public static void main(String [] args)
{
	JTimePanel v_JTimePanel = new JTimePanel();
	
	JFrame     v_Frame = new JFrame();
	JTextField v_Text  = new JTextField();
	
	v_Text.setBackground(Color.ORANGE);
	
	v_JTimePanel.addTimeChangeListener(new JTimePanelTest(v_Text));
	
	Date v_Now = new Date();
	
	v_JTimePanel.setValue(v_Now);
	
	v_Frame.getContentPane().setLayout(new BorderLayout());
	v_Frame.getContentPane().add(v_JTimePanel ,BorderLayout.CENTER);
	v_Frame.getContentPane().add(v_Text       ,BorderLayout.SOUTH);
	
	v_Frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
	v_Frame.setSize(800, 600);
	v_Frame.setVisible(true);
}
 
Example 13
Project: QN-ACTR-Release   File: WarningScrollTable.java   View source code 6 votes vote down vote up
/**
 * Creates the panel to be shown when the table is empty
 * @param msg message to be shown on the panel
 * @return created warning panel
 */
protected JPanel createWarningPanel(String msg) {
	JPanel warning = new JPanel(new GridBagLayout());
	JPanel innerPanel = new JPanel(new BorderLayout());
	// Adds image
	JLabel icon = new JLabel("");
	icon.setIcon(JMTImageLoader.loadImage("Triangle"));
	icon.setHorizontalAlignment(SwingConstants.CENTER);
	icon.setBorder(BorderFactory.createEmptyBorder(BORDERSIZE, BORDERSIZE, BORDERSIZE, BORDERSIZE));
	innerPanel.add(icon, BorderLayout.NORTH);
	// Adds Text Area
	JTextArea text = new JTextArea();
	text.setEditable(false);
	text.setWrapStyleWord(true);
	text.setLineWrap(true);
	text.setText(msg);
	text.setBorder(BorderFactory.createEmptyBorder(BORDERSIZE, BORDERSIZE, BORDERSIZE, BORDERSIZE));
	text.setBackground(icon.getBackground());
	innerPanel.add(text, BorderLayout.CENTER);
	innerPanel.setBorder(BorderFactory.createEtchedBorder());
	innerPanel.setPreferredSize(warningBoxSize);
	warning.add(innerPanel);
	return warning;
}
 
Example 14
Project: incubator-netbeans   File: ProfilingPointsDisplayer.java   View source code 6 votes vote down vote up
private void initComponents() {
    setLayout(new BorderLayout());
    setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    listModel = new DefaultListModel();
    list = new JList(listModel);
    list.getAccessibleContext().setAccessibleName(Bundle.ProfilingPointsDisplayer_ListAccessName());
    list.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    list.setVisibleRowCount(6);
    list.setCellRenderer(org.netbeans.modules.profiler.ppoints.Utils.getPresenterListRenderer());

    JScrollPane listScroll = new JScrollPane(list, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                             JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    listScroll.setPreferredSize(new Dimension(405, listScroll.getPreferredSize().height));

    add(listScroll, BorderLayout.CENTER);
}
 
Example 15
Project: incubator-netbeans   File: ThreadDumpWindow.java   View source code 6 votes vote down vote up
public ThreadDumpWindow(ThreadDump td) {
    setLayout(new BorderLayout());
    setFocusable(true);
    setRequestFocusEnabled(true);
    setName(Bundle.ThreadDumpWindow_Caption(StringUtils.formatUserDate(td.getTime())));
    setIcon(Icons.getImage(ProfilerIcons.THREAD));

    StringBuilder text = new StringBuilder();
    printThreads(text, td);
    a = new HTMLTextArea() {
        protected void showURL(URL url) {
            if (url == null) {
                return;
            }
            String urls = url.toString();
            ThreadDumpWindow.this.showURL(urls);
        }
    };
    a.setEditorKit(new CustomHtmlEditorKit());
    a.setText(text.toString());
    a.setCaretPosition(0);
    JScrollPane sp = new JScrollPane(a);
    sp.setBorder(BorderFactory.createEmptyBorder());
    sp.setViewportBorder(BorderFactory.createEmptyBorder());
    add(sp, BorderLayout.CENTER);
}
 
Example 16
Project: KernelHive   File: ResourceMonitorPanel.java   View source code 6 votes vote down vote up
/**
 *
 */
public ResourceMonitorPanel() {
	setLayout(new BorderLayout(0, 0));

	picturePanel = new JPanel();
	picturePanel.setLayout(new BoxLayout(picturePanel, BoxLayout.PAGE_AXIS));

	JScrollPane scroll = new JScrollPane(picturePanel);
	add(scroll);

	final JPanel buttonPanel = new JPanel();
	add(buttonPanel, BorderLayout.SOUTH);

	btnRefresh = new JButton("Refresh");
	buttonPanel.add(btnRefresh);

	autoRefreshCheckbox = new JCheckBox("Auto-refresh", true);
	buttonPanel.add(autoRefreshCheckbox);
}
 
Example 17
Project: openjdk-jdk10   File: bug8017284.java   View source code 6 votes vote down vote up
public static void main(String[] args) throws Exception {

        Robot robot = new Robot();
        SwingUtilities.invokeAndWait(() -> {
            frame = new JFrame();
            frame.setSize(500, 500);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

            tabbedPane = new JTabbedPane();

            for (int i = 0; i < TAB_COUNT; i++) {
                tabbedPane.add("Header " + i, new JLabel("Content: " + i));
            }

            frame.getContentPane().setLayout(new BorderLayout());
            frame.getContentPane().add(tabbedPane, BorderLayout.CENTER);
            frame.setVisible(true);
        });

        robot.waitForIdle();

        SwingUtilities.invokeAndWait(() -> {
            for (int j = 0; j < ITERATIONS; j++) {
                for (int i = 0; i < TAB_COUNT; i++) {
                    tabbedPane.setTitleAt(i, getHtmlText(j * TAB_COUNT + i));
                }
            }
        });
        robot.waitForIdle();

        SwingUtilities.invokeAndWait(() -> frame.dispose());
    }
 
Example 18
Project: ramus   File: AbstractTableView.java   View source code 6 votes vote down vote up
protected void createInnerComponent() {
    panel.removeAll();
    Attribute[] attributes = getAttributes();
    RootCreater rootCreater = getRootCreater();

    component = new RowTreeTableComponent(engine, qualifier, accessRules,
            rootCreater, attributes, framework);

    rowSet = component.getRowSet();
    table = component.getTable();

    table.getTreeSelectionModel().addTreeSelectionListener(
            new TreeSelectionListener() {
                @Override
                public void valueChanged(TreeSelectionEvent e) {
                    refreshActions();
                }
            });
    refreshActions();
    panel.add(component, BorderLayout.CENTER);
    panel.revalidate();
    panel.repaint();
}
 
Example 19
Project: AgentWorkbench   File: BasicGraphGui.java   View source code 6 votes vote down vote up
/**
 * This method initializes this
 */
private void initialize() {

	// --- Set appearance -----------------------------
	this.setVisible(true);
	this.setSize(300, 300);
	this.setLayout(new BorderLayout());
	this.setDoubleBuffered(true);
	
	// --- Add components -----------------------------
	this.add(this.getJPanelToolBars(), BorderLayout.WEST);
	this.add(this.getGraphZoomScrollPane(), BorderLayout.CENTER);

	this.addContainerListener(new ContainerAdapter() {
		boolean doneAdded = false;
		@Override
		public void componentAdded(ContainerEvent ce) {
			if (doneAdded==false) {
				validate();
				zoomSetInitialScalingAndMovement(getVisualizationViewer());
				doneAdded=true;
			}
		}
	});
}
 
Example 20
Project: incubator-netbeans   File: XmlMultiViewElement.java   View source code 6 votes vote down vote up
private void runInAwt() {
    if (doc instanceof NbDocument.CustomToolbar) {
        realToolBar = ((NbDocument.CustomToolbar) doc).createToolbar(editorPane);
    }
    synchronized (XmlMultiViewElement.this) {
        if (realToolBar == null) {
            toolbar = new JPanel();
        } else {
            toolbar = realToolBar;
        }
        initializer = null;
    }
    if (realToolBar == null) {
        return;
    }
    
    // patch existing toolbars
    for (JComponent p : toolbarPanels) {
        if (p.isValid()) {
            p.add(realToolBar, BorderLayout.CENTER);
        }
    }
}
 
Example 21
Project: KernelHive   File: InfrastructureBrowser.java   View source code 6 votes vote down vote up
public InfrastructureBrowser(final MainFrame frame, final String title) {
	super(frame);
	this.setName(title);
	setLayout(new BorderLayout());

	graphPanel = new InfrastructureGraphPanel(frame);
	add(graphPanel, BorderLayout.CENTER);

	Button refreshButton = new Button("Refresh");
	refreshButton.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			loadInfrastructure();
		}
	});
	add(refreshButton, BorderLayout.SOUTH);

	service = new WebServiceHelper().getMonitoringService();

	SwingUtilities.invokeLater(new Runnable() {
		@Override
		public void run() {
			loadInfrastructure();
		}
	});
}
 
Example 22
Project: sstore-soft   File: DatabaseManagerSwing.java   View source code 6 votes vote down vote up
/**
 * Could somebody explain what the purpose of this method is?
 * Contrary to the method name, it looks like it displays
 * results only if gridFormat is off (seems like it  does
 * nothing otherwise, except for clearing help text and moving focus).
 */
private void updateResult() {

    if (gridFormat) {

        // in case 'help' has removed the grid
        if (bHelp) {
            pResult.removeAll();
            pResult.add(gScrollPane, BorderLayout.CENTER);
            pResult.doLayout();
            gResult.fireTableChanged(null);
            pResult.repaint();

            bHelp = false;
        }
    } else {
        showResultInText();
    }

    txtCommand.selectAll();
    txtCommand.requestFocus();
}
 
Example 23
Project: smile_1.5.0_java7   File: ProjectionDemo.java   View source code 6 votes vote down vote up
@Override
public void run() {
    startButton.setEnabled(false);
    datasetBox.setEnabled(false);

    try {
    	JComponent plot = learn();
    	if (plot != null) {
    		if (canvas != null)
    			remove(canvas);
    		canvas = plot;
    		add(plot, BorderLayout.CENTER);
    	}
    	validate();
    } catch (Exception ex) {
    	System.err.println(ex);
    }
    
    startButton.setEnabled(true);
    datasetBox.setEnabled(true);
}
 
Example 24
Project: myster   File: MessageWindow.java   View source code 6 votes vote down vote up
public MessageTextArea(boolean editable, String text, String labelText) {
    setLayout(new BorderLayout());

    area = new JTextArea("");
    area.setSize(400, 400);
    area.setWrapStyleWord(true);
    area.setAutoscrolls(true);
    area.setLineWrap(true);
    area.setEditable(editable);
    area.setText(text);

    JScrollPane scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.getViewport().add(area);
    scrollPane.setDoubleBuffered(true);
    add(scrollPane, "Center");

    JLabel message = new JLabel(labelText);
    add(message, "North");
}
 
Example 25
Project: Dahlem_SER316   File: DailyItemsPanel.java   View source code 6 votes vote down vote up
void toggleButton_actionPerformed(ActionEvent e) {
    if (expanded) {
        expanded = false;
        toggleButton.setIcon(expIcon);
        controlPanel.remove(toggleToolBar);
        controlPanel.add(toggleToolBar, BorderLayout.EAST);
        splitPane.setDividerLocation((int) controlPanel.getMinimumSize().getWidth());

    }
    else {
        expanded = true;
        toggleButton.setIcon(collIcon);
        controlPanel.remove(toggleToolBar);
        controlPanel.add(toggleToolBar, BorderLayout.SOUTH);
        splitPane.setDividerLocation((int) controlPanel.getPreferredSize().getWidth());
    }
}
 
Example 26
Project: rapidminer   File: ROCComparisonRenderer.java   View source code 6 votes vote down vote up
@Override
public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) {
	ROCComparison model = (ROCComparison) renderable;
	ROCChartPlotter plotter = new ROCChartPlotter();
	Iterator<Map.Entry<String, List<ROCData>>> e = model.getRocData().entrySet().iterator();
	while (e.hasNext()) {
		Map.Entry<String, List<ROCData>> entry = e.next();
		plotter.addROCData(entry.getKey(), entry.getValue());
	}

	JPanel panel = new JPanel(new BorderLayout());
	JPanel innerPanel = new JPanel(new BorderLayout());
	innerPanel.add(plotter);
	innerPanel.setBorder(BorderFactory.createMatteBorder(10, 10, 5, 5, Colors.WHITE));
	panel.add(innerPanel, BorderLayout.CENTER);
	return panel;
}
 
Example 27
Project: incubator-netbeans   File: TitledMenuSeparator.java   View source code 6 votes vote down vote up
public TitledMenuSeparator(String text) {
    setLayout(new BorderLayout());
    setOpaque(false);

    JLabel l = new JLabel(text);
    l.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
    if (UIUtils.isWindowsLookAndFeel()) l.setOpaque(true);
    l.setFont(l.getFont().deriveFont(Font.BOLD, l.getFont().getSize2D() - 1));
    if (UIUtils.isWindowsLookAndFeel()) l.setForeground(UIUtils.getDisabledLineColor());
    
    add(l, BorderLayout.WEST);
    
    if (UIUtils.isGTKLookAndFeel()) {
        add(UIUtils.createHorizontalSeparator(), BorderLayout.CENTER);
    } else {
        JComponent sep = new JPopupMenu.Separator();
        add(sep, BorderLayout.CENTER);
        
        if (UIUtils.isOracleLookAndFeel()) {
            setOpaque(true);
            setBackground(sep.getBackground());
            l.setForeground(sep.getForeground());
        }
    }
}
 
Example 28
Project: incubator-netbeans   File: MultiViewPeer.java   View source code 6 votes vote down vote up
void initComponents() {
        initActionMap();
        peer.setLayout(new BorderLayout());
        tabs = new TabsComponent(isToolbarVisible());
        peer.add(tabs);
        ActionMap map = peer.getActionMap();
        Action act = new AccessTogglesAction();
        map.put("NextViewAction", new GetRightEditorAction()); //NOI18N
        map.put("PreviousViewAction", new GetLeftEditorAction()); //NOI18N
        map.put("accesstoggles", act); //NOI18N
        InputMap input = peer.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
        KeyStroke stroke = KeyStroke.getKeyStroke("control F10"); //NOI18N
        input.put(stroke, "accesstoggles"); //NOI18N
//        stroke = (KeyStroke)new GetLeftEditorAction().getValue(Action.ACCELERATOR_KEY);
//        input.put(stroke, "getLeftEditor");
        input = peer.getInputMap(JComponent.WHEN_FOCUSED);
        input.put(stroke, "accesstoggles"); //NOI18N
        
        peer.putClientProperty("MultiViewBorderHack.topOffset", new Integer(tabs.getPreferredSize().height - 1));
    }
 
Example 29
Project: lazycat   File: MainPanel.java   View source code 6 votes vote down vote up
private MainPanel() {

		GUIUtil.setImageIcon(bTomcat, "server.png", "������");
		GUIUtil.setImageIcon(bWebApp, "webapp.png", "WEBӦ��");
		GUIUtil.setImageIcon(bConsole, "console.png", "����̨���");
		GUIUtil.setImageIcon(bErrorLog, "error.png", "����ʧ����־");
		GUIUtil.setImageIcon(bAbout, "about.png", "��Դ��ַ");

		tb.setFloatable(false);
		tb.add(bTomcat);
		tb.add(bWebApp);
		tb.add(bConsole);
		tb.add(bErrorLog);
		tb.add(bAbout);

		workingPanel = new CenterPanel(0.8);

		setLayout(new BorderLayout());
		add(tb, BorderLayout.NORTH);
		add(workingPanel, BorderLayout.CENTER);

		addListener();
	}
 
Example 30
Project: incubator-netbeans   File: DocumentViewPanel.java   View source code 6 votes vote down vote up
private void setFilterVisible(boolean visible, boolean requestFocus) {
    northPanel.remove(filterTextField);
    if (visible) {
        //update the UI
        northPanel.add(filterTextField, BorderLayout.CENTER);
        //set the filter text to the node
        filter.setPattern(filterTextField.getText());

        if(requestFocus) {
            filterTextField.requestFocus();
        }
    } else {
        //just remove the filter text from the node, but keep it in the field
        //so next time it is opened it will contain the old value
        filter.setPattern(null);
    }
    northPanel.revalidate();
    northPanel.repaint();
}
 
Example 31
Project: jmt   File: StationNamePanel.java   View source code 5 votes vote down vote up
/**
 * Inits this panel's components and their action listeners
 */
private void init() {
	setLayout(new BorderLayout(5, 5));
	setBorder(new TitledBorder(new EtchedBorder(), "Station Name"));
	add(new JLabel("Station Name: "), BorderLayout.WEST);
	name.setText(sd.getStationName(key));
	add(name, BorderLayout.CENTER);
	add(Box.createVerticalStrut(5), BorderLayout.SOUTH);
	inputListener listener = new inputListener();
	name.addKeyListener(listener);
	name.addFocusListener(listener);
}
 
Example 32
Project: OpenDiabetes   File: Transfer.java   View source code 5 votes vote down vote up
/**
 * Method declaration
 *
 *
 * @param center
 */
private Panel createBorderPanel(Component center) {

    Panel p = new Panel();

    p.setBackground(SystemColor.control);
    p.setLayout(new BorderLayout());
    p.add("Center", center);
    p.add("South", createLabel(""));
    p.add("East", createLabel(""));
    p.add("West", createLabel(""));
    p.setBackground(SystemColor.control);

    return p;
}
 
Example 33
Project: incubator-netbeans   File: ResetResultsProfilingPoint.java   View source code 5 votes vote down vote up
private void initComponents() {
    setLayout(new BorderLayout());

    JPanel contentsPanel = new JPanel(new BorderLayout());
    contentsPanel.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.setOpaque(true);
    contentsPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 15, 15, UIUtils.getProfilerResultsBackground()));

    headerArea = new HTMLTextArea() {
            protected void showURL(URL url) {
                Utils.openLocation(ResetResultsProfilingPoint.this.getLocation());
            }
        };

    JScrollPane headerAreaScrollPane = new JScrollPane(headerArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                       JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    headerAreaScrollPane.setBorder(BorderFactory.createMatteBorder(0, 0, 15, 0, UIUtils.getProfilerResultsBackground()));
    headerAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    contentsPanel.add(headerAreaScrollPane, BorderLayout.NORTH);

    dataArea = new HTMLTextArea();

    JScrollPane dataAreaScrollPane = new JScrollPane(dataArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                     JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    TitledBorder tb = new TitledBorder(Bundle.ResetResultsProfilingPoint_DataString());
    tb.setTitleFont(Utils.getTitledBorderFont(tb).deriveFont(Font.BOLD));
    tb.setTitleColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
    dataAreaScrollPane.setBorder(tb);
    dataAreaScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
    dataAreaScrollPane.setBackground(UIUtils.getProfilerResultsBackground());
    contentsPanel.add(dataAreaScrollPane, BorderLayout.CENTER);

    add(contentsPanel, BorderLayout.CENTER);
}
 
Example 34
Project: jmt   File: MainJwatWizard.java   View source code 5 votes vote down vote up
/**
 * Initializes JWAT start screen GUI
 */
private void initGUI() {
	this.setIconImage(JMTImageLoader.loadImage(IMG_JWATICON).getImage());
	//this.setResizable(false);
	this.setTitle(TITLE);
	this.setSize(CommonConstants.MAX_GUI_WIDTH_JWAT, CommonConstants.MAX_GUI_HEIGHT_JWAT);
	centerWindow();
	menus = new JPanel(new BorderLayout());
	help = this.getHelp();
	getContentPane().add(menus, BorderLayout.NORTH);
	//Aggiunta del pannello principale dell'applicazione
	mainPanel = new JWatMainPanel(this);
	this.addPanel(mainPanel);
	setEnableButton("Solve", false);
}
 
Example 35
Project: jmt   File: InputSectionPanel.java   View source code 5 votes vote down vote up
private void initComponents() {
	this.setBorder(new EmptyBorder(5, 5, 5, 5));
	this.setLayout(new BorderLayout(5, 5));
	infiniteQueueSelector = new JRadioButton("Infinite");
	finiteQueueSelector = new JRadioButton("Finite");
	queueLengthGroup = new ButtonGroup();
	queueLengthGroup.add(infiniteQueueSelector);
	queueLengthGroup.add(finiteQueueSelector);
	queueLengthSpinner = new JSpinner();
	queueLengthSpinner.setValue(new Integer(1));
	queueLengthSpinner.setPreferredSize(DIM_BUTTON_XS);
	queueTable = new QueueTable();

	//queue details panel
	JPanel queuePolicyPanel = new JPanel(new BorderLayout());
	queuePolicyPanel.setBorder(new TitledBorder(new EtchedBorder(), "Queue Policy"));
	queuePolicyPanel.add(new WarningScrollTable(queueTable, WARNING_CLASS), BorderLayout.CENTER);
	JPanel queueLengthPanel = new JPanel(new GridLayout(3, 1, 3, 3));
	queueLengthPanel.setBorder(new TitledBorder(new EtchedBorder(), "Capacity"));

	// Queue strategy selector
	JPanel queueStrategy = new JPanel(new BorderLayout());
	queueStrategy.add(new JLabel("Station queue policy: "), BorderLayout.WEST);
	queuePolicyCombo = new JComboBox();
	queueStrategy.add(queuePolicyCombo, BorderLayout.CENTER);
	queuePolicyPanel.add(queueStrategy, BorderLayout.NORTH);
	queueStrategy.setBorder(BorderFactory.createEmptyBorder(2, 5, 10, 5));

	queueLengthPanel.add(infiniteQueueSelector);
	queueLengthPanel.add(finiteQueueSelector);
	JPanel spinnerPanel = new JPanel();
	JLabel label = new JLabel("<html>Max no. customers <br>(queue+service)</html>");
	label.setToolTipText("The maximum number of customers allowed in the station.");
	spinnerPanel.add(label);
	spinnerPanel.add(queueLengthSpinner);
	queueLengthPanel.add(spinnerPanel);

	this.add(queueLengthPanel, BorderLayout.WEST);
	this.add(queuePolicyPanel, BorderLayout.CENTER);
}
 
Example 36
Project: rapidminer   File: LocationSelectionStep.java   View source code 5 votes vote down vote up
@Override
public void viewWillBecomeVisible(WizardDirection direction) throws InvalidConfigurationException {
	final DataSource dataSource = wizard.getDataSource(DataSource.class);

	// update view content
	viewWrapper.removeAll();
	if (dataSource != null) {

		SwingTools.invokeAndWait(new Runnable() {

			@Override
			public void run() {
				@SuppressWarnings("rawtypes")
				DataSourceFactory factory = DataSourceFactoryRegistry.INSTANCE.lookUp(dataSource.getClass());

				locationStep = factory.createLocationStep(wizard);

				// create and add view component
				JComponent viewComponent = locationStep.getView();
				viewWrapper.add(viewComponent, BorderLayout.CENTER);
			}

		});

		// register for location change events
		locationStep.addChangeListener(changeListener);
		locationStep.viewWillBecomeVisible(direction);
	}
}
 
Example 37
Project: SER316-Munich   File: StickerExpand.java   View source code 5 votes vote down vote up
void jbInit() throws Exception {
	border1 =
			BorderFactory.createCompoundBorder(
					BorderFactory.createEtchedBorder(
							Color.white,
							new Color(156, 156, 158)),
							BorderFactory.createEmptyBorder(5, 5, 5, 5));
	border2 = BorderFactory.createEmptyBorder(5, 0, 5, 0);
	panel1.setLayout(borderLayout1);
	this.getContentPane().setLayout(borderLayout2);

	bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
	topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
	topPanel.setBorder(new EmptyBorder(new Insets(0, 5, 0, 5)));
	topPanel.setBackground(Color.WHITE);

	jPanel1.setLayout(borderLayout3);
	panel1.setBorder(border1);
	jPanel1.setBorder(border2);

	getContentPane().add(panel1, BorderLayout.CENTER);
	panel1.add(jScrollPane1, BorderLayout.CENTER);
	jScrollPane1.getViewport().add(stickerText, null);
	panel1.add(jPanel1, BorderLayout.SOUTH);
	this.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
	this.getContentPane().add(topPanel, BorderLayout.NORTH);

	stickerText.setText(txt);
	stickerText.setOpaque(true);
	stickerText.setBackground(backGroundColor);
	stickerText.setForeground(foreGroundColor);
}
 
Example 38
Project: ramus   File: EvalQualifierSetupEditor.java   View source code 5 votes vote down vote up
@Override
public JComponent createComponent() {
    JPanel panel = new JPanel(new BorderLayout());

    JScrollPane pane = new JScrollPane();
    panel.add(pane, BorderLayout.CENTER);
    JTable table = new JTable(this);
    pane.setViewportView(table);

    return panel;
}
 
Example 39
Project: jmt   File: InputPanel.java   View source code 5 votes vote down vote up
/**
 * Sets up combobox filter defined
 */
private void initComboFilterPanel() {
	filterchooser.addItem(FILTER_TEXT_COMPLETE);
	filterchooser.addItem(FILTER_TEXT_RANDOM);
	filterchooser.addItem(FILTER_TEXT_INTERVAL);
	filterchooser.setToolTipText(COMBO_FILTER_INPUT);

	createIntervalOptionPanel();
	createRandomOptionPanel();

	filterchooser.addActionListener(new ActionListener() {

		public void actionPerformed(ActionEvent event) {
			int index = ((JComboBox) event.getSource()).getSelectedIndex();
			switch (index) {
			case 0:
				optionFilterPanel.removeAll();
				optionFilterPanel.revalidate();
				optionFilterPanel.repaint();
				break;
			case 1:
				optionFilterPanel.removeAll();
				optionFilterPanel.add(createRandomOptionPanel(), BorderLayout.CENTER);
				optionFilterPanel.revalidate();
				optionFilterPanel.repaint();
				break;
			case 2:
				optionFilterPanel.removeAll();
				optionFilterPanel.add(createIntervalOptionPanel(), BorderLayout.CENTER);
				optionFilterPanel.revalidate();
				optionFilterPanel.repaint();
				break;
			}
		}

	});
	filterchooser.setSelectedIndex(0);
}
 
Example 40
Project: parabuild-ci   File: Transfer.java   View source code 5 votes vote down vote up
/**
 * Method declaration
 *
 *
 * @param center
 */
private Panel createBorderPanel(Component center) {

    Panel p = new Panel();

    p.setBackground(SystemColor.control);
    p.setLayout(new BorderLayout());
    p.add("Center", center);
    p.add("South", createLabel(""));
    p.add("East", createLabel(""));
    p.add("West", createLabel(""));
    p.setBackground(SystemColor.control);

    return p;
}