List of usage examples for java.awt BorderLayout PAGE_END
String PAGE_END
To view the source code for java.awt BorderLayout PAGE_END.
Click Source Link
From source file:visualizer.datamining.dataanalysis.NeighborhoodHit.java
/** This method is called from within the constructor to * initialize the form./*from w ww . ja va 2 s . c o m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonPanel = new javax.swing.JPanel(); saveImageButton = new javax.swing.JButton(); closeButton = new javax.swing.JButton(); dataPanel = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Neighborhood Hit"); setModal(true); saveImageButton.setText("Save Image"); saveImageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveImageButtonActionPerformed(evt); } }); buttonPanel.add(saveImageButton); closeButton.setText("Close"); closeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { closeButtonActionPerformed(evt); } }); buttonPanel.add(closeButton); getContentPane().add(buttonPanel, java.awt.BorderLayout.PAGE_END); dataPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); dataPanel.setLayout(new java.awt.BorderLayout()); getContentPane().add(dataPanel, java.awt.BorderLayout.CENTER); pack(); }
From source file:com.microsoft.alm.plugin.idea.ui.common.tabs.TabFormImpl.java
/** * Create the tab view if not already done *///from ww w . j a v a 2 s . c o m protected void ensureInitialized() { if (!initialized) { createCustomView(); createFilterToolbar(); //toolbars final JPanel toolBarPanel; if (ApplicationManager.getApplication() != null) { final ActionToolbar prActionsToolbar = createToolbar(createActionsGroup()); final ActionToolbar feedbackActionsToolbar = createToolbar(createFeedbackGroup()); // left panel of the top toolbar final FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT, 0, JBUI.scale(3)); // give vertical padding final JPanel toolBarPanelLeft = new JPanel(flowLayout); toolBarPanelLeft.add(prActionsToolbar.getComponent()); toolBarPanelLeft.add(searchFilter); //entire top toolbar toolBarPanel = new JPanel(new BorderLayout()); toolBarPanel.add(toolBarPanelLeft, BorderLayout.LINE_START); toolBarPanel.add(feedbackActionsToolbar.getComponent(), BorderLayout.LINE_END); } else { //skip setup when called from unit tests toolBarPanel = new JPanel(); } //status panel with label and link final JPanel statusPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); statusLabel = new JLabel(); statusLink = new Hyperlink(); statusLink.setActionCommand(CMD_STATUS_LINK); statusPanel.add(statusLabel); statusPanel.add(statusLink); //tabPanel tabPanel = new JPanel(new BorderLayout()); tabPanel.add(toolBarPanel, BorderLayout.PAGE_START); tabPanel.add(scrollPanel, BorderLayout.CENTER); tabPanel.add(statusPanel, BorderLayout.PAGE_END); this.initialized = true; } }
From source file:TextComponentDemo.java
public TextComponentDemo() { super("TextComponentDemo"); // Create the text pane and configure it. textPane = new JTextPane(); textPane.setCaretPosition(0);//www . java 2 s. co m textPane.setMargin(new Insets(5, 5, 5, 5)); StyledDocument styledDoc = textPane.getStyledDocument(); if (styledDoc instanceof AbstractDocument) { doc = (AbstractDocument) styledDoc; //doc.setDocumentFilter(new DocumentSizeFilter(MAX_CHARACTERS)); } else { System.err.println("Text pane's document isn't an AbstractDocument!"); System.exit(-1); } JScrollPane scrollPane = new JScrollPane(textPane); scrollPane.setPreferredSize(new Dimension(200, 200)); // Create the text area for the status log and configure it. changeLog = new JTextArea(5, 30); changeLog.setEditable(false); JScrollPane scrollPaneForLog = new JScrollPane(changeLog); // Create a split pane for the change log and the text area. JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, scrollPaneForLog); splitPane.setOneTouchExpandable(true); // Create the status area. JPanel statusPane = new JPanel(new GridLayout(1, 1)); CaretListenerLabel caretListenerLabel = new CaretListenerLabel("Caret Status"); statusPane.add(caretListenerLabel); // Add the components. getContentPane().add(splitPane, BorderLayout.CENTER); getContentPane().add(statusPane, BorderLayout.PAGE_END); // Set up the menu bar. createActionTable(textPane); JMenu editMenu = createEditMenu(); JMenu styleMenu = createStyleMenu(); JMenuBar mb = new JMenuBar(); mb.add(editMenu); mb.add(styleMenu); setJMenuBar(mb); // Add some key bindings. addBindings(); // Put the initial text into the text pane. initDocument(); // Start watching for undoable edits and caret changes. doc.addUndoableEditListener(new MyUndoableEditListener()); textPane.addCaretListener(caretListenerLabel); doc.addDocumentListener(new MyDocumentListener()); }
From source file:visualizer.datamining.dataanalysis.NeighborhoodPreservation.java
/** This method is called from within the constructor to * initialize the form.//from ww w . j av a 2 s . c o m * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonPanel = new javax.swing.JPanel(); saveImageButton = new javax.swing.JButton(); closeButton = new javax.swing.JButton(); dataPanel = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Neighborhood Preservation"); setModal(true); saveImageButton.setText("Save Image"); saveImageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveImageButtonActionPerformed(evt); } }); buttonPanel.add(saveImageButton); closeButton.setText("Close"); closeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { closeButtonActionPerformed(evt); } }); buttonPanel.add(closeButton); getContentPane().add(buttonPanel, java.awt.BorderLayout.PAGE_END); dataPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); dataPanel.setLayout(new java.awt.BorderLayout()); getContentPane().add(dataPanel, java.awt.BorderLayout.CENTER); pack(); }
From source file:org.rdv.viz.dial.DialPanel.java
/** * Initializes the dial panel./*ww w.ja va 2s . c om*/ */ private void initPanel() { setLayout(new BorderLayout()); JPanel chartPanel = createDialPanel(); add(chartPanel, BorderLayout.CENTER); JPanel settingsPanel = createSettingsPanel(); add(settingsPanel, BorderLayout.PAGE_END); }
From source file:TextComponentDemo.java
public TextComponentDemo() { super("TextComponentDemo"); // Create the text pane and configure it. textPane = new JTextPane(); textPane.setCaretPosition(0);/*from w w w.ja va 2s .c om*/ textPane.setMargin(new Insets(5, 5, 5, 5)); StyledDocument styledDoc = textPane.getStyledDocument(); if (styledDoc instanceof AbstractDocument) { doc = (AbstractDocument) styledDoc; doc.setDocumentFilter(new DocumentSizeFilter(MAX_CHARACTERS)); } else { System.err.println("Text pane's document isn't an AbstractDocument!"); System.exit(-1); } JScrollPane scrollPane = new JScrollPane(textPane); scrollPane.setPreferredSize(new Dimension(200, 200)); // Create the text area for the status log and configure it. changeLog = new JTextArea(5, 30); changeLog.setEditable(false); JScrollPane scrollPaneForLog = new JScrollPane(changeLog); // Create a split pane for the change log and the text area. JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, scrollPaneForLog); splitPane.setOneTouchExpandable(true); // Create the status area. JPanel statusPane = new JPanel(new GridLayout(1, 1)); CaretListenerLabel caretListenerLabel = new CaretListenerLabel("Caret Status"); statusPane.add(caretListenerLabel); // Add the components. getContentPane().add(splitPane, BorderLayout.CENTER); getContentPane().add(statusPane, BorderLayout.PAGE_END); // Set up the menu bar. actions = createActionTable(textPane); JMenu editMenu = createEditMenu(); JMenu styleMenu = createStyleMenu(); JMenuBar mb = new JMenuBar(); mb.add(editMenu); mb.add(styleMenu); setJMenuBar(mb); // Add some key bindings. addBindings(); // Put the initial text into the text pane. initDocument(); textPane.setCaretPosition(0); // Start watching for undoable edits and caret changes. doc.addUndoableEditListener(new MyUndoableEditListener()); textPane.addCaretListener(caretListenerLabel); doc.addDocumentListener(new MyDocumentListener()); }
From source file:TextComponentDemo.java
public TextComponentDemo() { super("TextComponentDemo"); //Create the text pane and configure it. textPane = new JTextPane(); textPane.setCaretPosition(0);//ww w .jav a 2 s.c o m textPane.setMargin(new Insets(5, 5, 5, 5)); StyledDocument styledDoc = textPane.getStyledDocument(); if (styledDoc instanceof AbstractDocument) { doc = (AbstractDocument) styledDoc; doc.setDocumentFilter(new DocumentSizeFilter(MAX_CHARACTERS)); } else { System.err.println("Text pane's document isn't an AbstractDocument!"); System.exit(-1); } JScrollPane scrollPane = new JScrollPane(textPane); scrollPane.setPreferredSize(new Dimension(200, 200)); //Create the text area for the status log and configure it. changeLog = new JTextArea(5, 30); changeLog.setEditable(false); JScrollPane scrollPaneForLog = new JScrollPane(changeLog); //Create a split pane for the change log and the text area. JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPane, scrollPaneForLog); splitPane.setOneTouchExpandable(true); //Create the status area. JPanel statusPane = new JPanel(new GridLayout(1, 1)); CaretListenerLabel caretListenerLabel = new CaretListenerLabel("Caret Status"); statusPane.add(caretListenerLabel); //Add the components. getContentPane().add(splitPane, BorderLayout.CENTER); getContentPane().add(statusPane, BorderLayout.PAGE_END); //Set up the menu bar. createActionTable(textPane); JMenu editMenu = createEditMenu(); JMenu styleMenu = createStyleMenu(); JMenuBar mb = new JMenuBar(); mb.add(editMenu); mb.add(styleMenu); setJMenuBar(mb); //Add some key bindings. addBindings(); //Put the initial text into the text pane. initDocument(); //Start watching for undoable edits and caret changes. doc.addUndoableEditListener(new MyUndoableEditListener()); textPane.addCaretListener(caretListenerLabel); doc.addDocumentListener(new MyDocumentListener()); }
From source file:jatoo.proxy.dialog.ProxyDialog.java
/** * Shows the dialog relative to the specified owner. *//*from w w w . ja v a 2 s . co m*/ public static synchronized void show(Component owner) { JDialog dialogTmp; if (owner == null) { dialogTmp = new JDialog(); } else { dialogTmp = new JDialog(SwingUtilities.getWindowAncestor(owner)); } final JDialog dialog = dialogTmp; // // the panel final ProxyDialogPanel dialogPanel = PROXY_DIALOG_PANEL_FACTORY.createDialogPanel(); try { Proxy proxy = new Proxy(); proxy.load(); dialogPanel.setProxyEnabled(proxy.isEnabled()); dialogPanel.setHost(proxy.getHost()); dialogPanel.setPort(proxy.getPort()); dialogPanel.setProxyRequiringAuthentication(proxy.isRequiringAuthentication()); dialogPanel.setUsername(proxy.getUsername()); dialogPanel.setPassword(proxy.getPassword()); } catch (FileNotFoundException e) { // do nothing, maybe is the first time and the file is missing } catch (Exception e) { logger.error("Failed to load the properties.", e); } // // buttons JButton okButton = new JButton("Ok"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ev) { try { if (dialogPanel.isProxyEnabled()) { if (dialogPanel.isProxyRequiringAuthentication()) { ProxyUtils.setProxy(dialogPanel.getHost(), dialogPanel.getPort(), dialogPanel.getUsername(), dialogPanel.getPassword()); } else { ProxyUtils.setProxy(dialogPanel.getHost(), dialogPanel.getPort()); } } else { ProxyUtils.removeProxy(); } dialog.dispose(); } catch (Exception e) { JOptionPane.showMessageDialog(dialog, "Failed to set the proxy:\n" + e.toString()); return; } try { Proxy proxy = new Proxy(); proxy.setEnabled(dialogPanel.isProxyEnabled()); proxy.setUsername(dialogPanel.getUsername()); proxy.setPassword(dialogPanel.getPassword()); proxy.setRequiringAuthentication(dialogPanel.isProxyRequiringAuthentication()); proxy.setHost(dialogPanel.getHost()); proxy.setPort(dialogPanel.getPort()); proxy.store(); } catch (Exception e) { logger.error("Failed to save the properties.", e); } } }); JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); // // layout dialog dialogPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); JPanel buttonsGroup = new JPanel(new GridLayout(1, 2, 5, 5)); buttonsGroup.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); buttonsGroup.add(okButton); buttonsGroup.add(cancelButton); JPanel buttonsPanel = new JPanel(new BorderLayout()); buttonsPanel.add(buttonsGroup, BorderLayout.LINE_END); JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(dialogPanel, BorderLayout.CENTER); contentPane.add(buttonsPanel, BorderLayout.PAGE_END); // // setup dialog dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setTitle("Proxy Settings"); dialog.setContentPane(contentPane); dialog.pack(); dialog.setLocationRelativeTo(dialog.getOwner()); dialog.setModal(true); // // and show dialog.setVisible(true); }
From source file:org.apache.jmeter.protocol.http.visualizers.RequestViewHTTP.java
@Override public void init() { paneParsed = new JPanel(new BorderLayout(0, 5)); paneParsed.add(createRequestPane()); this.searchTextExtension = new SearchTextExtension(); this.searchTextExtension.init(paneParsed); JPanel searchPanel = this.searchTextExtension.createSearchTextExtensionPane(); searchPanel.setBorder(null);//from w ww. j ava 2s. com this.searchTextExtension.setSearchProvider(new RequestViewHttpSearchProvider()); searchPanel.setVisible(true); paneParsed.add(searchPanel, BorderLayout.PAGE_END); }
From source file:com.microsoft.alm.plugin.idea.common.ui.common.tabs.TabFormImpl.java
/** * Create the tab view if not already done *///from ww w . j a v a 2s . c o m protected void ensureInitialized() { if (!initialized) { createCustomView(); createFilterToolbar(); //toolbars final JPanel toolBarPanel; if (ApplicationManager.getApplication() != null) { final ActionToolbar prActionsToolbar = createToolbar(createActionsGroup()); final ActionToolbar feedbackActionsToolbar = createToolbar(createFeedbackGroup()); final ActionToolbar optionsActionsToolbar = createToolbar(createOptionsGroup()); // left panel of the top toolbar final FlowLayout flowLayout = new FlowLayout(FlowLayout.LEFT, 0, JBUI.scale(3)); // give vertical padding final JPanel toolBarPanelLeft = new JPanel(flowLayout); toolBarPanelLeft.add(prActionsToolbar.getComponent()); toolBarPanelLeft.add(searchFilter); addCustomTools(toolBarPanelLeft); // middle panel of the top toolbar final FlowLayout flowLayout2 = new FlowLayout(FlowLayout.LEFT, 0, JBUI.scale(3)); // give vertical padding final JPanel toolBarPanelMiddle = new JPanel(flowLayout2); toolBarPanelMiddle.add(optionsActionsToolbar.getComponent()); SwingHelper.setMargin(toolBarPanelMiddle, new Insets(JBUI.scale(2), JBUI.scale(15), 0, 0)); //entire top toolbar toolBarPanel = new JPanel(new BorderLayout()); toolBarPanel.add(toolBarPanelLeft, BorderLayout.LINE_START); toolBarPanel.add(toolBarPanelMiddle, BorderLayout.CENTER); toolBarPanel.add(feedbackActionsToolbar.getComponent(), BorderLayout.LINE_END); } else { //skip setup when called from unit tests toolBarPanel = new JPanel(); } //status panel with label and link final JPanel statusPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); statusLabel = new JLabel(); statusLink = new Hyperlink(); statusLink.setActionCommand(CMD_STATUS_LINK); statusPanel.add(statusLabel); statusPanel.add(statusLink); //tabPanel tabPanel = new JPanel(new BorderLayout()); tabPanel.add(toolBarPanel, BorderLayout.PAGE_START); tabPanel.add(scrollPanel, BorderLayout.CENTER); tabPanel.add(statusPanel, BorderLayout.PAGE_END); this.initialized = true; } }