public SoundFontViewer() { this.setLayout(new BorderLayout()); JSplitPane split = new JSplitPane(); this.add(split, BorderLayout.CENTER); FileTree fTree = new FileTree(); fTree.setMinimumSize(new Dimension(0, 0)); String[] filters = {".sf2"}; fTree.setFilters(filters); fTree.addFileTreeListener(this::getSoundFontInfo); fTree.addFileTreePopup(new SFFileTreePopup()); JTabbedPane tabs = new JTabbedPane(); JScrollPane scrollInstrument = new JScrollPane(); scrollInstrument.setBorder(null); scrollInstrument.setViewportView(instrumentInfo); JScrollPane scrollPreset = new JScrollPane(); scrollPreset.setBorder(null); scrollPreset.setViewportView(presetInfo); tabs.add("Instruments", scrollInstrument); tabs.add("Presets", scrollPreset); split.add(fTree, JSplitPane.LEFT); split.add(tabs, JSplitPane.RIGHT); split.setDividerLocation(200); }
public void createJPanel() { JSplitPane graphSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT); graphSplit.setLeftComponent(previewPanel); graphSplit.setRightComponent(dataPanel); graphSplit.setOneTouchExpandable(true); graphSplit.setDividerLocation(400); JPanel graphHolder = new JPanel(new BorderLayout()); graphHolder.add(graphSplit, BorderLayout.CENTER); graphHolder.setBorder(BorderFactory.createTitledBorder("")); JPanel tool = new JPanel(new BorderLayout()); tool.add(saveCSVData, BorderLayout.SOUTH); tool.add(aScanType, BorderLayout.CENTER); JPanel leftPanel = new JPanel(new BorderLayout()); leftPanel.add(graphHolder, BorderLayout.CENTER); leftPanel.add(tool, BorderLayout.SOUTH); JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); split.setOneTouchExpandable(true); split.setRightComponent(imageViewPanel); split.setLeftComponent(leftPanel); split.setDividerLocation(600); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(split, BorderLayout.CENTER); getContentPane().setLayout(new BorderLayout()); getContentPane().add(mainPanel); aScanType.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { imageViewPanel.setViewType(aScanType.getSelectedIndex()); } }); saveCSVData.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { File f = FileSelectionField.getUserFile(); f = FileOperations.renameFileType(f, "csv"); saveAScanData(f); } catch (Exception e1) { JOptionPane.showMessageDialog( null, "Error : " + e1.getLocalizedMessage(), "Error Saving Data", JOptionPane.ERROR_MESSAGE); e1.printStackTrace(); } } }); }
public static void showTree( final HighlighterParserListener highlighterParserListener, final DebuggerParserListener debugListener, final ListenedParser parser, StringBuilder sourceCode, final JTextPane textPane, JTree stacktraceTree, JTree executionTree, JTree productionsTree, final JFrame jframe, final JTextField textField, final JCheckBox skipSmall, final JSpinner skipSizeSpinner, final ParserListenerMultiplexer parserListenerMultiplexer, JCheckBox skipAll) { jframe.setLocation(100, 100); JSplitPane treesSplitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, false, new JScrollPane(executionTree), new JScrollPane(productionsTree)); treesSplitPane.setDividerLocation(300); JScrollPane textPanelScrollPane = new JScrollPane(textPane); JSplitPane newRightComponent = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, true, textPanelScrollPane, new JScrollPane(stacktraceTree)); newRightComponent.setDividerLocation(900); JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, treesSplitPane, newRightComponent); verticalSplitPane.setDividerLocation(200); addPopupMenu(textPane, debugListener); JPanel mainPanel = new JPanel(new BorderLayout()); JToolBar toolBar = createToolbar( highlighterParserListener, debugListener, parser, stacktraceTree, textField, skipSmall, skipSizeSpinner, skipAll, textPane); mainPanel.add(toolBar, BorderLayout.PAGE_START); mainPanel.add(verticalSplitPane, BorderLayout.CENTER); jframe.setContentPane(mainPanel); jframe.setSize(1200, 1000); jframe.setVisible(true); }
public UserGUI() { super("접속을 환영합니다^^"); this.setEnabled(false); // this.login = login; new LoginGUI(this); jp.setDividerLocation(345); jp2.setDividerLocation(345); p4.setMinimumSize(new Dimension(400, 300)); // 툴바 컴포넌트에 버튼 삽입 tb1.add(btn1); tb1.add(btn2); tb1.add(btn3); tb2.add(btn4); tb2.add(btn5); tb3.add(btn7); tb3.add(btn8); p2.setLayout(new BorderLayout()); p2.add(tb2, "North"); // 툴바2를 패널2에 삽입 p2.add(jp, "Center"); // 그래프가 들어갈 패널 jp을 패널2에 넣음 p3.setLayout(new BorderLayout()); p3.add(tb3, "North"); p3.add(jp2, "Center"); // 탭 컴포넌트에 패널1,2,3을 넣음 tp.add(p2, "체중변화"); tp.add(p3, "식단관리"); tp.add(p1, "개인정보변경"); p8.setLayout(new FlowLayout(FlowLayout.RIGHT)); p8.add(la); p8.add(btn6); add(p8, "North"); add(tp, "Center"); // add(p8,"East"); setSize(800, 700); // 전체 창 크기 // 창을 화면 가운데(x,y좌표에) 띄우겠다는 메소드 int x = (Toolkit.getDefaultToolkit().getScreenSize().width - getSize().width) / 2; int y = (Toolkit.getDefaultToolkit().getScreenSize().height - getSize().height) / 2; setLocation(x, y); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); btn6.addActionListener(this); btn4.addActionListener(this); btn8.addActionListener(this); }
/** Initializes the frame components. */ private void initialize() { GridBagConstraints c; // Set title, size and menus setDefaultCloseOperation(EXIT_ON_CLOSE); setTitle("Mibble MIB Browser"); Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); Rectangle bounds = new Rectangle(); bounds.width = (int) (size.width * 0.75); bounds.height = (int) (size.height * 0.75); bounds.x = (size.width - bounds.width) / 2; bounds.y = (size.height - bounds.height) / 2; setBounds(bounds); setMenuBar(menuBar); initializeMenu(); getContentPane().setLayout(new GridBagLayout()); // Add horizontal split pane JSplitPane horizontalSplitPane = new JSplitPane(); horizontalSplitPane.setDividerLocation((int) (bounds.width * 0.35)); c = new GridBagConstraints(); c.weightx = 1.0d; c.weighty = 1.0d; c.fill = GridBagConstraints.BOTH; getContentPane().add(horizontalSplitPane, c); // Add status label c = new GridBagConstraints(); c.gridy = 1; c.fill = GridBagConstraints.BOTH; c.insets = new Insets(2, 5, 2, 5); getContentPane().add(statusLabel, c); // Add MIB tree mibTree = MibTreeBuilder.getInstance().getTree(); mibTree.addTreeSelectionListener( new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { updateTreeSelection(); } }); horizontalSplitPane.setLeftComponent(new JScrollPane(mibTree)); // Add description area & SNMP panel JSplitPane verticalSplitPane = new JSplitPane(); verticalSplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); verticalSplitPane.setDividerLocation((int) (bounds.height * 0.40)); verticalSplitPane.setOneTouchExpandable(true); descriptionArea.setEditable(false); verticalSplitPane.setLeftComponent(new JScrollPane(descriptionArea)); snmpPanel = new SnmpPanel(this); verticalSplitPane.setRightComponent(snmpPanel); horizontalSplitPane.setRightComponent(verticalSplitPane); }
public boolean execute(PlugInContext context) throws Exception { JSplitPane splitpane = (JSplitPane) appContext.getBlackboard().get(ConstantesGestorFIP.OPEN_GESTORFIP); if (splitpane.getDividerLocation() <= 1) { splitpane.setDividerLocation(400); } else { splitpane.setDividerLocation(0); } return true; }
private Component getSplitPane( HtmlRendererContext context, int[] colLengths, int firstCol, int numCols, int[] rowLengths, int firstRow, int numRows, Component[] frameComponents) { if (numCols == 1) { int frameindex = colLengths.length * firstRow + firstCol; Component topComponent = frameindex < frameComponents.length ? frameComponents[frameindex] : null; if (numRows == 1) { return topComponent; } else { Component bottomComponent = this.getSplitPane( context, colLengths, firstCol, numCols, rowLengths, firstRow + 1, numRows - 1, frameComponents); JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topComponent, bottomComponent); sp.setDividerLocation(rowLengths[firstRow]); return sp; } } else { Component rightComponent = this.getSplitPane( context, colLengths, firstCol + 1, numCols - 1, rowLengths, firstRow, numRows, frameComponents); Component leftComponent = this.getSplitPane( context, colLengths, firstCol, 1, rowLengths, firstRow, numRows, frameComponents); JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftComponent, rightComponent); sp.setDividerLocation(colLengths[firstCol]); return sp; } }
public SplitPaneDemo2() { super("SplitPaneDemo2"); // Create an instance of SplitPaneDemo SplitPaneDemo splitPaneDemo = new SplitPaneDemo(); JSplitPane top = splitPaneDemo.getSplitPane(); splitPaneDemo.getImageList().addListSelectionListener(this); // XXXX: Bug #4131528, borders on nested split panes accumulate. // Workaround: Set the border on any split pane within // another split pane to null. Components within nested split // panes need to have their own border for this to work well. top.setBorder(null); // Create a regular old label label = new JLabel("Click on an image name in the list.", JLabel.CENTER); // Create a split pane and put "top" (a split pane) // and JLabel instance in it. JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, top, label); splitPane.setOneTouchExpandable(true); splitPane.setDividerLocation(180); // Provide minimum sizes for the two components in the split pane top.setMinimumSize(new Dimension(100, 50)); label.setMinimumSize(new Dimension(100, 30)); // Add the split pane to this frame getContentPane().add(splitPane); }
/** * Restores window state from the preferences storage, including window size and position, and * splitter bar position. */ private void restoreWindowState() { Preferences prefs = Preferences.userNodeForPackage(getClass()).node(NODENAME); mSizePosSaver.restoreSizeAndPosition(); mChatSplitter.setDividerLocation(prefs.getInt(CHAT_SPLIT_POS, getHeight() - 100)); }
public PrinterStatusPanel(Executor exe) { this.exe = exe; myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.PAGE_AXIS)); myPanel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createLineBorder(Color.black), "Printer Status")); // Temperature plot tempPanel = new TemperaturePanel(exe); // Text Area for Log Messages statusText.setEditable(false); statusText.setFont(new Font(Font.MONOSPACED, Font.PLAIN, FONT_SIZE)); statusText.setLineWrap(false); statusText.setText(OFFLINE_MESSAGE); final DefaultCaret caret = (DefaultCaret) statusText.getCaret(); caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE); scrollPane = new JScrollPane(statusText); scrollPane.setViewportView(statusText); final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, tempPanel.getPanel(), scrollPane); splitPane.setDividerLocation(300); myPanel.add(splitPane); GuiAppender.setTextArea(statusText); }
public static JSplitPane createSplitPane( int splitOrientation, Component comp1, Component comp2, int divider) { JSplitPane js = new JSplitPane(splitOrientation, comp1, comp2); js.setOneTouchExpandable(true); js.setDividerLocation(divider); return js; }
/** * Creates a tileset editor. * * @param mainWindow The main window of the quest editor. * @param tileset Id of the tileset to open. * @throws QuestEditorException If the tileset could not be loaded. */ public TilesetEditorPanel(EditorWindow mainWindow, String tilesetId) throws QuestEditorException { super(mainWindow, getEditorId(tilesetId)); setLayout(new BorderLayout()); // tile patterns list and tileset image // tile patterns list tilePatternsView = new TilePatternsView(); tilePatternsView.setAlignmentY(Component.TOP_ALIGNMENT); tilePatternsView.setPreferredSize(new Dimension(200, Integer.MAX_VALUE)); tilePatternsView.setMinimumSize(new Dimension(0, 0)); // tileset image tilesetImageView = new TilesetImageView(true); JScrollPane tilesetImageScroller = new JScrollPane(tilesetImageView); tilesetImageScroller.setAlignmentY(Component.TOP_ALIGNMENT); JSplitPane tilesetPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tilePatternsView, tilesetImageScroller); tilesetPanel.setContinuousLayout(true); tilesetPanel.setDividerLocation(400); // we must put our main panel in another panel // otherwise the background color of the window is bad add(tilesetPanel); tileset = new Tileset(tilesetId); // Notify the children views. tilePatternsView.setTileset(tileset); tilesetImageView.setTileset(tileset); }
/** * This method sets the location of the divider. A value of 0 sets the divider to the farthest * left. A value of 1 sets the divider to the farthest right. * * @param proportionalLocation A double that describes the location of the divider. * @throws IllegalArgumentException if <code>proportionalLocation</code> is not in the range from * 0.0 to 1.0 inclusive. */ public void setDividerLocation(double proportionalLocation) { if (proportionalLocation > 1 || proportionalLocation < 0) throw new IllegalArgumentException("proportion has to be between 0 and 1."); int max = ((orientation == HORIZONTAL_SPLIT) ? getWidth() : getHeight()) - getDividerSize(); setDividerLocation((int) (proportionalLocation * max)); }
// Makes sure the log is visible. private static void displayLog() { if (!consoleDisplayed) { splitter.add(outputScroll); splitter.setDividerLocation(defaultSliderPosition); consoleDisplayed = true; } }
public void selectFirstEntry() { if (entryTable.getRowCount() > 0) { entryTable.setRowSelectionInterval(0, 0); } else { contentPane.setDividerLocation(1.0f); } }
/** * Constructor * * @param mt Map transform * @param type Layer geometry type * @param layer Layer * @param style Style */ public SimpleStyleEditor(MapTransform mt, Type type, ILayer layer, Style style) { // Set the layout. super(new BorderLayout()); // Recover the first three paramters. this.mt = mt; this.type = type; this.layer = layer; // Get the geometry type and available legends. this.geometryType = (type == null) ? SimpleGeometryType.ALL : SimpleGeometryType.getSimpleType(type); // Initialize the dialog container, adding the empty dialog. cardLayout = new CardLayout(); dialogContainer = new JPanel(cardLayout); dialogContainer.setPreferredSize(new Dimension(640, 420)); addEmptyDialog(); // Add all panels. styleWrapper = addAllPanels(style); // Initialize the legend tree. legendTree = new LegendTree(this); // Put everything inside a split pane. JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, legendTree, dialogContainer); // Should be just wide enough for "Interval classification - Point" splitPane.setDividerLocation(260); Dimension minimumSize = new Dimension(100, 50); legendTree.setMinimumSize(minimumSize); dialogContainer.setMinimumSize(minimumSize); add(splitPane, BorderLayout.CENTER); }
/** Creates the basic GUI */ public void createGUI() { this.addWindowListener(new BootstrapperWindowListener()); /* Setup the Contacts Panel */ contacts = new JTextArea(10, 20); /* Setup the Content Panel */ content = new JTextArea(10, 20); /* Populate the data */ this.populateData(); this.contactsScrollPane = new JScrollPane(this.contacts); contactsScrollPane.setMinimumSize(new Dimension(400, 800)); this.contentScrollPane = new JScrollPane(this.content); contentScrollPane.setMinimumSize(new Dimension(400, 800)); this.splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, this.contactsScrollPane, this.contentScrollPane); splitPane.setDividerLocation(FRAME_WIDTH / 4); splitPane.setSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT)); this.getContentPane().add(splitPane, BorderLayout.CENTER); }
private void initView() { AutomatonEditorPanel<T, S> panel = getEditorPanel(); T auto = panel.getAutomaton(); initTable(myAlg.getConvertedGrammar(), new UndoKeeper()); panel.setTool(createArrowTool(panel, auto)); MagnifiableScrollPane scroll = new MagnifiableScrollPane(myTable); scroll.setMinimumSize(myTable.getMinimumSize()); JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panel, scroll); Dimension size = getPreferredSize(), scrollSize = myTable.getMinimumSize(); double width = size.width + scrollSize.width; split.setPreferredSize(new Dimension((int) width, size.height)); double ratio = size.width / width; split.setDividerLocation(ratio); split.setResizeWeight(ratio); SizeSlider slider = new SizeSlider(scroll); JToolBar toolbar = initToolbar(); add(split, BorderLayout.CENTER); add(slider, BorderLayout.SOUTH); add(toolbar, BorderLayout.NORTH); slider.distributeMagnification(); size = new Dimension( (int) width, size.height + slider.getPreferredSize().height + toolbar.getPreferredSize().height); setPreferredSize(size); }
public SHCEEMain() { super(); mySHCEEMain = this; initializeMainFrame(); valueEditor = new ValueEditorPanel(); deviceSelector = new DeviceSelectorPanel(); jSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); jSplitPane.add(deviceSelector); jSplitPane.add(valueEditor); add(jSplitPane); ComponentListener resizeListener = new ComponentAdapter() { public void componentResized(ComponentEvent e) { onResize(); } }; addComponentListener(resizeListener); jSplitPane.setDividerLocation(defaultWidth * 45 / 100); }
private void initGUI() { this.setTitle("Notizen"); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.lp, this.np); splitPane.setOneTouchExpandable(true); splitPane.setDividerLocation(200); // Provide minimum sizes for the two components in the split pane Dimension minimumSize = new Dimension(200, 100); this.lp.setMinimumSize(minimumSize); this.np.setMinimumSize(minimumSize); this.setLayout(new BorderLayout()); this.addWindowListener(this.c); this.setSize(700, 400); this.setLocationRelativeTo(null); this.add(splitPane, BorderLayout.CENTER); this.setVisible(true); }
public SplitPaneDemo() { // Create the list of images and put it in a scroll pane. list = new JList(imageNames); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.setSelectedIndex(0); list.addListSelectionListener(this); JScrollPane listScrollPane = new JScrollPane(list); picture = new JLabel(); picture.setFont(picture.getFont().deriveFont(Font.ITALIC)); picture.setHorizontalAlignment(JLabel.CENTER); JScrollPane pictureScrollPane = new JScrollPane(picture); // Create a split pane with the two scroll panes in it. splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listScrollPane, pictureScrollPane); splitPane.setOneTouchExpandable(true); splitPane.setDividerLocation(150); // Provide minimum sizes for the two components in the split pane. Dimension minimumSize = new Dimension(100, 50); listScrollPane.setMinimumSize(minimumSize); pictureScrollPane.setMinimumSize(minimumSize); // Provide a preferred size for the split pane. splitPane.setPreferredSize(new Dimension(400, 200)); updateLabel(imageNames[list.getSelectedIndex()]); }
private void addSidePane() { getContentPane().remove(mainPane); splitPane.setRightComponent(mainPane); getContentPane().add(splitPane); int i = preferences().getIntProperty("InstrumentsDbFrame.dividerLocation"); if (i != 0) splitPane.setDividerLocation(i); }
public HttpClientFrame() { client = new HttpClient(new MultiThreadedHttpConnectionManager()); client.getHttpConnectionManager().getParams().setConnectionTimeout(30000); JPanel panInput = new JPanel(new FlowLayout()); String[] aURLs = { "http://www.apache.org/", "http://www.google.com/", "http://www.opensource.org/", "http://www.anybrowser.org/", "http://jakarta.apache.org/", "http://www.w3.org/" }; final JButton btnGET = new JButton("GET"); btnGET.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent ae) { String url = (String) cmbURL.getSelectedItem(); if (url != null && url.length() > 0) { loadPage(url); } } }); cmbURL = new JComboBox(aURLs); cmbURL.setToolTipText("Enter a URL"); cmbURL.setEditable(true); cmbURL.setSelectedIndex(0); JLabel lblURL = new JLabel("URL:"); panInput.add(lblURL); panInput.add(cmbURL); panInput.add(btnGET); taTextResponse = new JTextArea(); taTextResponse.setEditable(false); taTextResponse.setCaretPosition(0); htmlPane = new JEditorPane(); htmlPane.setContentType("text/html"); htmlPane.setEditable(false); JSplitPane splitResponsePane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, new JScrollPane(taTextResponse), new JScrollPane(htmlPane)); splitResponsePane.setOneTouchExpandable(false); splitResponsePane.setDividerLocation(350); // it would be better to set resizeWeight, but this method does // not exist in JRE 1.2.2 // splitResponsePane.setResizeWeight(0.5); this.getContentPane().setLayout(new BorderLayout()); this.getContentPane().add(panInput, BorderLayout.NORTH); this.getContentPane().add(splitResponsePane, BorderLayout.CENTER); }
public CFAccSwingSecGroupFormViewEditJPanel( ICFAccSwingSchema argSchema, ICFSecuritySecGroupFormObj argFocus) { super(); final String S_ProcName = "construct-schema-focus"; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 1, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. swingSchema = argSchema; setSwingFocus(argFocus); setSize(1024, 480); splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); attrJPanel = argSchema.getSecGroupFormFactory().newAttrJPanel(argFocus); attrScrollPane = new CFHSlaveJScrollPane(attrJPanel); eltJTabbedPane = argSchema.getSecGroupFormFactory().newEltJTabbedPane(argFocus); splitPane.setTopComponent(attrScrollPane); splitPane.setBottomComponent(eltJTabbedPane); add(splitPane); splitPane.setBounds(0, 0, 1024, 455); splitPane.setDividerLocation(200); if (getSwingFocus() != null) { setPanelMode(CFJPanel.PanelMode.View); } doLayout(); }
private JSplitPane createMessageLedgerSplitter(JScrollPane ledger, RvDetailsPanel details) { final JSplitPane splitter = new JSplitPane(JSplitPane.VERTICAL_SPLIT, ledger, details); splitter.setOneTouchExpandable(true); splitter.setDividerLocation(0.5); splitter.setBorder(BorderFactory.createEmptyBorder()); return splitter; }
/** * Descripción de Método * * @param gc * @return */ public boolean includeTab(GridController gc) { MTab imcludedMTab = gc.getMTab(); if (m_mTab.getIncluded_Tab_ID() != imcludedMTab.getAD_Tab_ID()) { return false; } // vIncludedGC = gc; vIncludedGC.switchMultiRow(); vIncludedGC.setRowSelectionAllowed(false); // Dimension size = getPreferredSize(); srPane.setResizeWeight(.75); // top part gets 75% srPane.add(vIncludedGC, JSplitPane.BOTTOM); srPane.setBottomComponent(vIncludedGC); srPane.setDividerSize(5); // int height = 150; vIncludedGC.setPreferredSize(new Dimension(600, height)); setPreferredSize(new Dimension(size.width, size.height + height)); srPane.setDividerLocation(size.height); // imcludedMTab.setIncluded(true); imcludedMTab.query(false, 0); // JRootPane rt = SwingUtilities.getRootPane(this); if (rt == null) { System.out.println("Root pane null"); } else { // System.out.println( "Root=" + rt ); rt.addMouseListener(vIncludedGC); Component gp = rt.getGlassPane(); if (gp == null) { System.out.println("No Glass Pane"); } else { // System.out.println( "Glass=" + gp ); gp.addMouseListener(vIncludedGC); } } vIncludedGC.addMouseListener(vIncludedGC); vIncludedGC.enableEvents(AWTEvent.HIERARCHY_EVENT_MASK + AWTEvent.MOUSE_EVENT_MASK); return true; } // IncludeTab
/** Sets the Splitter attribute of the JMiddlegenFrame object */ public void setSplitter() { int fheight = this.getHeight(); int sheight = Toolkit.getDefaultToolkit().getScreenSize().height; if (fheight >= sheight) { _split.setDividerLocation(sheight - 480); } _split.setOneTouchExpandable(true); }
private JSplitPane buildSplitPane(Preferences preferences) { JSplitPane splitPane = new JSplitPane(); splitPane.setDoubleBuffered(true); splitPane.setLeftComponent(new JScrollPane(this.buildTree(preferences))); splitPane.setRightComponent(new JScrollPane(this.buildTable())); splitPane.setDividerLocation(150); return splitPane; }
// Makes sure the log is visible. private static void displayLog() { println("Displayed", warning); if (!consoleDisplayed) { splitter.add(outputScroll); splitter.setDividerLocation(.8); consoleDisplayed = true; } }
/** * Layout the GUI components for this RootFolder with an expandable JTree on the left of a * SplitPane and the main panel on the right. */ private void layoutWithFolderTree() { // get the JTree Component tree = getFolderTree(); if (rootIsVisible == false) // hide the root node { tree.setRootVisible(false); } // Enable tool tips. ToolTipManager.sharedInstance().registerComponent(tree); // embed the JTree in a scrollpane JScrollPane treeScrollPane = new JScrollPane(tree); // the left and right sides of the JSplitPane JComponent leftside, rightside = mainPanel; if (globalParams == null && buttonPanel == null) { // Create a split pane with the treePane on the left and the main panel on the right leftside = treeScrollPane; } else { /* the left side has global parameters and/or buttons so we need to create a * vertical split pane for the tree and the parameters/buttons */ JComponent globalParamsBox = globalParams; // globalparams could be null but buttonpanel could not be if (buttonPanel != null) { // add buttonPanel to a vertical box with globalParams Box box = Box.createVerticalBox(); if (globalParams != null) { box.add(globalParams); box.add(Box.createVerticalGlue()); } box.add(buttonPanel); globalParamsBox = box; } // create the vertical split pane leftside = new JSplitPane( JSplitPane.VERTICAL_SPLIT, treeScrollPane, new JScrollPane(globalParamsBox)); } // create the horizontal split pane with the left and right sides JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftside, rightside); splitPane.setOneTouchExpandable(true); // set the divider location to be 150 pixels from the left splitPane.setDividerLocation(150); // add the split pane to this component add(splitPane, BorderLayout.CENTER); }