List of usage examples for javax.swing JSplitPane JSplitPane
public JSplitPane(int newOrientation, Component newLeftComponent, Component newRightComponent)
JSplitPane
with the specified orientation and the specified components. From source file:edu.ucla.stat.SOCR.applications.demo.BlackScholesApplication.java
public void init() { updateGraph();//from www. j a v a 2s. c om s_serie = new XYSeries("S", false); upContainer = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(leftPanel), new JScrollPane(chartPanel)); this.getMainPanel().removeAll(); this.getMainPanel().add(new JScrollPane(upContainer), BorderLayout.CENTER); this.getMainPanel().validate(); }
From source file:com.sshtools.tunnel.PortForwardingPane.java
public PortForwardingPane(ActiveTunnelsSessionPanel sessionPanel) { super(new BorderLayout()); this.sessionPanel = sessionPanel; JPanel north = new JPanel(new BorderLayout()); table = new PortForwardingTable(model = new PortForwardingModel()); table.setShowGrid(false);//from w w w . j a va 2s . c om table.setShowHorizontalLines(false); table.setShowVerticalLines(false); table.setIntercellSpacing(new Dimension(0, 0)); table.setColumnSelectionAllowed(false); table.getColumnModel().getColumn(0).setMaxWidth(25); table.getColumnModel().getColumn(0).setMinWidth(25); table.getColumnModel().getColumn(1).setMaxWidth(60); table.getColumnModel().getColumn(1).setMinWidth(60); table.getColumnModel().getColumn(2).setMaxWidth(60); table.getColumnModel().getColumn(2).setMinWidth(60); table.getColumnModel().getColumn(3).setMaxWidth(150); table.getColumnModel().getColumn(3).setMinWidth(80); //table.getColumnModel().getColumn(4).setMaxWidth(150); //table.getColumnModel().getColumn(4).setMinWidth(80); table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); // Scroller for table JScrollPane scroller = new JScrollPane(table) { public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, 164); } }; // Create the active forward pane active = new ActiveChannelPane(); // Create the top panel JPanel top = new JPanel(new BorderLayout()); top.add(north, BorderLayout.NORTH); top.add(scroller, BorderLayout.CENTER); // Create the split pane for forward selection / active channels split = new JSplitPane(JSplitPane.VERTICAL_SPLIT, top, active); split.setOneTouchExpandable(true); split.setDividerSize(7); // Create the panel add(split, BorderLayout.CENTER); // Hide the active channel display initially toggleActiveChannelDisplay(); // Initialise setClient(null); }
From source file:edu.ucla.stat.SOCR.chart.demo.PowerTransformXYScatterChart.java
public void init() { sliderPanel = new JPanel(); powerXSlider = new FloatSlider("PowerX", 1.0, -10.0, 10.0); powerXSlider.setPreferredSize(new Dimension(CHART_SIZE_X / 2 + 150, 80)); powerXSlider.addObserver(this); powerXSlider.setToolTipText("Slider for adjusting the value of power for the axis."); sliderPanel.add(this.powerXSlider); powerYSlider = new FloatSlider("PowerY", 1.0, -10.0, 10.0); powerYSlider.setPreferredSize(new Dimension(CHART_SIZE_X / 2 + 150, 80)); powerYSlider.addObserver(this); powerYSlider.setToolTipText("Slider for adjusting the value of power for the Y axis."); sliderPanel.add(this.powerYSlider); super.init(); toolBar = new JToolBar(); createActionComponents(toolBar);// w w w. j a va 2 s . c o m JPanel toolBarContainer = new JPanel(); toolBarContainer.add(toolBar); JSplitPane toolContainer = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolBarContainer, new JScrollPane(sliderPanel)); toolContainer.setContinuousLayout(true); toolContainer.setDividerLocation(0.6); this.getContentPane().add(toolContainer, BorderLayout.NORTH); }
From source file:edu.ucla.stat.SOCR.chart.demo.PowerTransformHistogramChart.java
public void init() { sliderPanel = new JPanel(); powerSlider = new FloatSlider("Power", 1.0, -10.0, 10.0); powerSlider.setPreferredSize(new Dimension(CHART_SIZE_X / 2 + 150, 80)); powerSlider.addObserver(this); powerSlider.setToolTipText("Slider for adjusting the value of power."); sliderPanel.add(this.powerSlider); binSlider2 = new FloatSlider("Bin Size", 5, 1, 10); super.reset_BinSlider(); binSlider2.setPreferredSize(new Dimension(CHART_SIZE_X / 2 + 150, 80)); binSlider2.addObserver(this); binSlider2.setToolTipText("Slider for adjusting the bin size."); sliderPanel.add(this.binSlider2); mapDep = false;//from ww w . ja va 2 s .c o m super.init(); indLabel.setText("Data"); // Y toolBar = new JToolBar(); createActionComponents(toolBar); JPanel toolBarContainer = new JPanel(); toolBarContainer.add(toolBar); JSplitPane toolContainer = new JSplitPane(JSplitPane.VERTICAL_SPLIT, toolBarContainer, new JScrollPane(sliderPanel)); toolContainer.setContinuousLayout(true); toolContainer.setDividerLocation(0.6); this.getContentPane().add(toolContainer, BorderLayout.NORTH); }
From source file:uk.co.petertribble.jangle.SnmpTreePanel.java
/** * Create a new SnmpTreePanel, starting exploration at the specified OID. * * @param startOID the OID to start from *///from w w w .j av a2 s . c om public SnmpTreePanel(String startOID) { this.startOID = startOID; setLayout(new BorderLayout()); jtpl = new JTabbedPane(); model = new DefaultListModel(); oidList = new ArrayList<SnmpObject>(); slist = new JList(model); slist.addListSelectionListener(this); slist.setCellRenderer(new SnmpListCellRenderer()); jtpl.add(SnmpResources.getString("SNMP.LIST.TEXT"), new JScrollPane(slist)); // we use explicit placement so the tabs can be manipulated later jtpr = new JTabbedPane(); // details tab jp1 = new JPanel(new BorderLayout()); jp2 = new JPanel(new BorderLayout()); tp = new JingleTextPane("text/plain"); jp1.add(new JScrollPane(tp)); // jp2 holds the chart jp2 = new JPanel(new BorderLayout()); JSplitPane jpt = new JSplitPane(JSplitPane.VERTICAL_SPLIT, jp1, jp2); jpt.setOneTouchExpandable(true); jpt.setDividerLocation(120); jtpr.insertTab(SnmpResources.getString("SNMP.DETAILS.TEXT"), (Icon) null, jpt, (String) null, TAB_D); tpdesc = new JingleTextPane("text/plain"); jtpr.insertTab(SnmpResources.getString("SNMP.ABOUT.TEXT"), (Icon) null, new JScrollPane(tpdesc), (String) null, TAB_A); // siblings tab tpsiblings = new JingleTextPane("text/plain"); jp3 = new JPanel(new BorderLayout()); jp3t = new JPanel(new BorderLayout()); JSplitPane jps = new JSplitPane(JSplitPane.VERTICAL_SPLIT, jp3t, jp3); jps.setOneTouchExpandable(true); jps.setDividerLocation(200); jtpr.insertTab(SnmpResources.getString("SNMP.SIBLINGS.TEXT"), (Icon) null, jps, (String) null, TAB_S); // cousins tab tpcousins = new JingleTextPane("text/plain"); jp4 = new JPanel(new BorderLayout()); jp4t = new JPanel(new BorderLayout()); JSplitPane jpc = new JSplitPane(JSplitPane.VERTICAL_SPLIT, jp4t, jp4); jpc.setOneTouchExpandable(true); jpc.setDividerLocation(200); jtpr.insertTab(SnmpResources.getString("SNMP.COUSINS.TEXT"), (Icon) null, jpc, (String) null, TAB_C); // split pane to hold the lot JSplitPane psplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, jtpl, jtpr); psplit.setOneTouchExpandable(true); psplit.setDividerLocation(200); add(psplit); }
From source file:sample.fa.ScriptRunnerApplication.java
void createGUI() { Box buttonBox = Box.createHorizontalBox(); JButton loadButton = new JButton("Load"); loadButton.addActionListener(this::loadScript); buttonBox.add(loadButton);/*ww w . ja v a2s. c o m*/ JButton saveButton = new JButton("Save"); saveButton.addActionListener(this::saveScript); buttonBox.add(saveButton); JButton executeButton = new JButton("Execute"); executeButton.addActionListener(this::executeScript); buttonBox.add(executeButton); languagesModel = new DefaultComboBoxModel(); ScriptEngineManager sem = new ScriptEngineManager(); for (ScriptEngineFactory sef : sem.getEngineFactories()) { languagesModel.addElement(sef.getScriptEngine()); } JComboBox<ScriptEngine> languagesCombo = new JComboBox<>(languagesModel); JLabel languageLabel = new JLabel(); languagesCombo.setRenderer((JList<? extends ScriptEngine> list, ScriptEngine se, int index, boolean isSelected, boolean cellHasFocus) -> { ScriptEngineFactory sef = se.getFactory(); languageLabel.setText(sef.getEngineName() + " - " + sef.getLanguageName() + " (*." + String.join(", *.", sef.getExtensions()) + ")"); return languageLabel; }); buttonBox.add(Box.createHorizontalGlue()); buttonBox.add(languagesCombo); scriptContents = new JTextArea(); scriptContents.setRows(8); scriptContents.setColumns(40); scriptResults = new JTextArea(); scriptResults.setEditable(false); scriptResults.setRows(8); scriptResults.setColumns(40); JSplitPane jsp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scriptContents, scriptResults); JFrame frame = new JFrame("Script Runner"); frame.add(buttonBox, BorderLayout.NORTH); frame.add(jsp, BorderLayout.CENTER); frame.pack(); frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); frame.setVisible(true); }
From source file:ec.util.chart.swing.JTimeSeriesRendererSupportDemo.java
public JTimeSeriesRendererSupportDemo() { this.colorSchemeSupport = SwingColorSchemeSupport.from(new TangoColorScheme()); this.support = new CustomRendererSupport(3, 24, colorSchemeSupport); this.chart = createTsChart(); RANDOM_DATA.executeSafely(chart);/*from ww w . j a v a 2 s . co m*/ setLayout(new BorderLayout()); add(createToolBar(), BorderLayout.NORTH); add(ModernUI.withEmptyBorders( new JSplitPane(JSplitPane.VERTICAL_SPLIT, createChartPanel(), createMissionControl())), BorderLayout.CENTER); }