private void createView(JPanel headerPanel, JTable table) { panel = new JPanel(new GridBagLayout()); panel.setPreferredSize(new Dimension(300, 500)); JScrollPane scrollPane = new JScrollPane(table); table.setFillsViewportHeight(true); scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weighty = 0.05; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.PAGE_START; panel.add(headerPanel, gbc); gbc.gridy = 2; gbc.weighty = 0.9; gbc.weightx = 1; gbc.fill = GridBagConstraints.BOTH; gbc.anchor = GridBagConstraints.BELOW_BASELINE; panel.add(scrollPane, gbc); }
JScrollPane scrollPane = new JScrollPane(table); table.setFillsViewportHeight(true); scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT);
notesScroll.setBorder(BorderFactory.createLineBorder(new Color(137, 137, 137))); notesScroll.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)); notesScroll.setAlignmentX(Component.LEFT_ALIGNMENT); controlsPanel.add(notesScroll); controlsPanel.add(Box.createVerticalStrut(10));
JLabel label = new JLabel("Option"); label.setAlignmentX(Component.LEFT_ALIGNMENT); // Added panel.add(label); JLabel a = new JLabel("A"); JLabel b = new JLabel("B"); JLabel c = new JLabel("C"); JLabel d = new JLabel("D"); JLabel e = new JLabel("E"); Box box = Box.createVerticalBox(); box.add(a); box.add(b); box.add(c); box.add(d); box.add(e); JScrollPane jscrlpBox = new JScrollPane(box); jscrlpBox.setPreferredSize(new Dimension(140, 90)); panel.add(jscrlpBox); jscrlpBox.setAlignmentX(Component.LEFT_ALIGNMENT); // Added
public NotesPanel(Note note){ this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); JLabel creatorLabel = new JLabel("Note by "+note.getCreator()+ " @ "+note.getDateCreated()); creatorLabel.setAlignmentX(JLabel.LEFT_ALIGNMENT); creatorLabel.setHorizontalAlignment(JLabel.LEFT); JTextArea notesContentsArea = new JTextArea(note.getContents()); notesContentsArea.setEditable(false); JScrollPane scrollPane = new JScrollPane(notesContentsArea); scrollPane.setAlignmentX(JScrollPane.LEFT_ALIGNMENT); JLabel editorLabel = new JLabel(" -- Last edited by "+note.getLastEdited() +" at "+note.getDateModified()); editorLabel.setAlignmentX(Component.LEFT_ALIGNMENT); editorLabel.setHorizontalAlignment(JLabel.LEFT); this.add(creatorLabel); this.add(scrollPane); this.add(editorLabel); this.setBorder(new BevelBorder(BevelBorder.RAISED)); }
JButton b1 = new JButton("button1"); String[] columnNames = { "kolumna 1", "kol 2", "kol3" }; JTable itemTable = new JTable(new DefaultTableModel(columnNames, 10)); JScrollPane scrollPane = new JScrollPane(itemTable); JButton b2 = new JButton("button2"); b1.setAlignmentX(Component.LEFT_ALIGNMENT); scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT); b2.setAlignmentX(Component.LEFT_ALIGNMENT); JPanel panel = new JPanel(); BoxLayout layout = new BoxLayout(panel, BoxLayout.Y_AXIS); panel.setLayout(layout); panel.add(b1); panel.add(scrollPane); panel.add(b2);
/** * Return the robotButtonsScrollPane * * @return JScrollPane */ private JScrollPane getRobotButtonsScrollPane() { if (robotButtonsScrollPane == null) { robotButtonsScrollPane = new JScrollPane(); robotButtonsScrollPane.setAutoscrolls(false); robotButtonsScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); robotButtonsScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); robotButtonsScrollPane.setAlignmentY(Component.TOP_ALIGNMENT); robotButtonsScrollPane.setMaximumSize(new Dimension(113, 32767)); robotButtonsScrollPane.setPreferredSize(new Dimension(113, 28)); robotButtonsScrollPane.setAlignmentX(Component.CENTER_ALIGNMENT); robotButtonsScrollPane.setMinimumSize(new Dimension(113, 53)); robotButtonsScrollPane.setViewportView(getRobotButtonsPanel()); } return robotButtonsScrollPane; }
static int showBugReportDialog(final String title, final String question, final int messageType, final Object[] options, final Object firstChoice, final String reportName, final String log) { final Box messagePane = Box.createVerticalBox(); final JLabel messageLabel = new JLabel(question); messageLabel.setAlignmentX(JLabel.LEFT_ALIGNMENT); messagePane.add(messageLabel); messagePane.add(Box.createVerticalStrut(10)); final JLabel messageLabel2 = new JLabel(reportName); messageLabel2.setAlignmentX(JLabel.LEFT_ALIGNMENT); messagePane.add(messageLabel2); final JTextArea historyArea = new JTextArea(log); historyArea.setEditable(false); final JScrollPane historyPane = new JScrollPane(historyArea); historyPane.setPreferredSize(new Dimension(500, 300)); historyPane.setAlignmentX(JLabel.LEFT_ALIGNMENT); messagePane.add(historyPane); final int choice = JOptionPane.showOptionDialog(UITools.getCurrentRootComponent(), messagePane, title, JOptionPane.DEFAULT_OPTION, messageType, null, options, firstChoice); return choice; } }
private JPanel createParametersPanel() { JPanel paramsPanel = new JPanel(); BoxLayout layout = new BoxLayout(paramsPanel, BoxLayout.PAGE_AXIS); paramsPanel.setLayout(layout); AbstractButton addParamBut = ToolButtonFactory.createButton(UIUtils.loadImageIcon("/org/esa/snap/resources/images/icons/Add16.png"), false); addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT); paramsPanel.add(addParamBut); this.paramsTable = new OperatorParametersTable(this.fakeOperatorDescriptor, appContext); JScrollPane tableScrollPane = new JScrollPane(paramsTable); tableScrollPane.setPreferredSize(new Dimension(500, 130)); tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT); paramsPanel.add(tableScrollPane); addParamBut.addActionListener((ActionEvent e) -> paramsTable.addParameterToTable()); TitledBorder title = BorderFactory.createTitledBorder("Template Parameters"); paramsPanel.setBorder(title); return paramsPanel; }
public FramebufferStateWindow(TR tr){ setTitle("Framebuffer States"); setSize(280,600); rootPanel.setLayout(new BoxLayout(rootPanel,BoxLayout.PAGE_AXIS)); scrollPane.setAlignmentX(LEFT_ALIGNMENT); add(scrollPane); this.setDefaultCloseOperation(HIDE_ON_CLOSE); this.tr=tr; }//end for(descriptors)
JScrollPane scroller = new JScrollPane(result); scroller.setPreferredSize(new Dimension(300, 250)); scroller.setAlignmentX(LEFT_ALIGNMENT);
JScrollPane scroller = new JScrollPane(result); scroller.setPreferredSize(new Dimension(300, 250)); scroller.setAlignmentX(LEFT_ALIGNMENT);
JScrollPane scroller = new JScrollPane(result); scroller.setPreferredSize(new Dimension(300, 250)); scroller.setAlignmentX(LEFT_ALIGNMENT);
@Override protected JPanel createParametersPanel() { JPanel paramsPanel = new JPanel(); BoxLayout layout = new BoxLayout(paramsPanel, BoxLayout.PAGE_AXIS); paramsPanel.setLayout(layout); AbstractButton addParamBut = ToolButtonFactory.createButton(UIUtils.loadImageIcon(Bundle.Icon_Add()), false); addParamBut.setText("New Parameter"); addParamBut.setMaximumSize(new Dimension(150, controlHeight)); addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT); addParamBut.setAlignmentY(Component.TOP_ALIGNMENT); paramsPanel.add(addParamBut); JScrollPane tableScrollPane = new JScrollPane(paramsTable); tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT); paramsPanel.add(tableScrollPane); addParamBut.addActionListener(e -> paramsTable.addParameterToTable()); return paramsPanel; }
@Override protected JPanel createParametersPanel() { JPanel paramsPanel = new JPanel(); BoxLayout layout = new BoxLayout(paramsPanel, BoxLayout.PAGE_AXIS); paramsPanel.setLayout(layout); AbstractButton addParamBut = ToolButtonFactory.createButton(UIUtils.loadImageIcon(Bundle.Icon_Add()), false); addParamBut.setAlignmentX(Component.LEFT_ALIGNMENT); addParamBut.setAlignmentY(Component.TOP_ALIGNMENT); paramsPanel.add(addParamBut); int tableWidth = (formWidth - 2 * DEFAULT_PADDING); int widths[] = {27, 120, (int)(tableWidth * 0.25), (int)(tableWidth * 0.1), 100, (int)(tableWidth * 0.32), 30}; for(int i=0; i < widths.length; i++) { paramsTable.getColumnModel().getColumn(i).setPreferredWidth(widths[i]); } JScrollPane tableScrollPane = new JScrollPane(paramsTable); tableScrollPane.setAlignmentX(Component.LEFT_ALIGNMENT); paramsPanel.add(tableScrollPane); addParamBut.addActionListener(e -> paramsTable.addParameterToTable(new ToolParameterDescriptor("parameterName", String.class), 0)); TitledBorder title = BorderFactory.createTitledBorder(Bundle.CTL_Panel_OpParams_Border_TitleText()); paramsPanel.setBorder(title); return paramsPanel; }
scroller.setAlignmentX(LEFT_ALIGNMENT); scroller.getViewport().setBackground(Color.white); scroller.setPreferredSize(new Dimension(width, (this.installData.guiPrefs.height / 3 + 30)));
varTable.setRowHeight(20); JScrollPane scrollPane = new JScrollPane(varTable); scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT); variablesBorderPanel.add(scrollPane); variablesBorderPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
scroller.setAlignmentX(LEFT_ALIGNMENT); add(scroller, NEXT_LINE);
scrollpane.setAlignmentX(LEFT_ALIGNMENT); scrollpane.setAlignmentY(BOTTOM_ALIGNMENT); return panelOne;