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"); }
/** * 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); }
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()); } }
/** * 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); }
/** * 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; } }
/** 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(); } }; }
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); } } }
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(); }
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(); }
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); }
/** * 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); }
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); }
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); }
/** * 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; }
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); }
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); }
/** * */ 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); }
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()); }
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(); }
/** * 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; } } }); }
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); } } }
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(); } }); }
/** * 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(); }
@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); }
@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; }
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()); } } }
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(); }
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(); }
/** * 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); }
/** * 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; }
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); }
/** * 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); }
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); }
@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); } }
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); }
@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; }
/** * 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); }
public PieceWindow() { root = new JPanel(new BorderLayout()); ActionListener al = new ActionListener() { public void actionPerformed(ActionEvent e) { launchButtonPressed(); } }; launch = new LaunchButton(Resources.getString("Editor.PieceWindow.pieces"), TOOLTIP, BUTTON_TEXT, HOTKEY, ICON, al); launch.setToolTipText(Resources.getString("Editor.PieceWindow.show_hide_pieces_window", Resources.getString("Editor.PieceWindow.pieces"))); }