private void createReplacePanel() { if (!table.isReadOnly()) { replaceField.setColumns(textFieldLength); replaceField.addKeyListener(new FindReplaceTextFieldKeyAdapter()); replaceButton = createButton(getResourceString("SS_SR_REPLACE")); replaceButton.addActionListener(replaceAction); replaceAllButton = createButton(getResourceString("SS_SR_REPLACEALL")); replaceAllButton.addActionListener(replaceAction); // replaceButton.setMnemonic(KeyEvent.VK_N); // replaceButton.addActionListener(searchAction); // JComponent[] itemSample = { new JMenuItem("Replace"), new JMenuItem("Replace All") }; // memoryReplaceButton = new MemoryDropDownButton("Replace", // IconManager.getIcon("DropDownArrow"), // 1, java.util.Arrays.asList(itemSample)); // memoryReplaceButton.setOverrideBorder(true, memoryReplaceButton.raisedBorder); // memoryReplaceButton.setEnabled(false); builder.add(replaceField, cc.xy(5, 3)); builder.add(replaceButton, cc.xy(7, 3)); builder.add(replaceAllButton, cc.xy(9, 3)); } }
private JPanel kibicPanel() { FormLayout layout3 = new FormLayout("730", "15px, 485px"); kibicPanel = new JPanel(layout3); // kibicPanel = new FormDebugPanel(layout3); CellConstraints cc = new CellConstraints(); JLabel labell = new JLabel("Wyloguj"); labell.addMouseListener( new MouseAdapter() { public void mousePressed(MouseEvent me) { CardLayout c1 = (CardLayout) (utworzPanel.getLayout()); c1.show(utworzPanel, "card1"); tx1.setText(""); tx2.setText(""); } }); Color c = new Color(153, 180, 209); kibicPanel.setBackground(c); tabbedPane = new JTabbedPane(JTabbedPane.LEFT); tabbedPane.setBorder(null); tabbedPane.addTab("Spotkania", new ImageIcon("images/spotkania.png"), new Spotkania()); Font font = new Font("Arial", Font.BOLD, 15); tabbedPane.setFont(font); tabbedPane.addTab("Król strzelców", new ImageIcon("images/krol.png"), new KrolStrzelcow()); tabbedPane.addTab("Ranking drużyn", new ImageIcon("images/ranking.png"), new RankingDruzyn()); // tabbedPane.addTab("") tabbedPane.setBackground(c); kibicPanel.add(tabbedPane, cc.xy(1, 2)); kibicPanel.add(labell, cc.xy(1, 1, CellConstraints.RIGHT, CellConstraints.TOP)); return kibicPanel; }
protected JPanel getMainPanel() { JPanel panel = new JPanel(); String cols = "5dlu, fill:pref:grow, 5dlu, fill:pref:grow, 5dlu"; String rows = "5dlu, pref, 5dlu, pref, 5dlu"; FormLayout layout = new FormLayout(cols, rows); panel.setLayout(layout); CellConstraints cc = new CellConstraints(); panel.add(new JLabel("Weight for edge:"), cc.xy(2, 2)); String text = edge.getWS(); tf = new JTextField(text); tf.addActionListener(this); panel.add(tf, cc.xy(4, 2)); jcbAnchored.addActionListener(this); jcbAnchored.setSelected(edge.isFixed()); if (!Configuration.getInstance().getGeneralConfig().getUnAnchor()) { panel.add(jcbAnchored, cc.xyw(2, 4, 3)); } return panel; }
protected JPanel getSubPanel() { JPanel panel = new JPanel(); String cols = "5dlu, fill:pref:grow, 5dlu, fill:pref:grow, 5dlu, fill:pref:grow, 5dlu"; String rows = "5dlu, pref, 5dlu, pref, 5dlu"; FormLayout layout = new FormLayout(cols, rows); panel.setLayout(layout); CellConstraints cc = new CellConstraints(); int row = 2; panel.add(new JLabel("Color:"), cc.xy(2, row)); colorLabel.setOpaque(true); colorLabel.setBackground(edge.color); panel.add(colorLabel, cc.xy(4, row)); jbColor.addActionListener(this); panel.add(jbColor, cc.xy(6, row)); row += 2; panel.add(new JLabel("Line width:"), cc.xy(2, row)); panel.add(spinner, cc.xy(4, row)); return panel; }
private void initView() { cancelButton = new JButton("Cancel"); proceedButton = new JButton("Continue"); attributesTable = new JTable(); // assemble CellConstraints cc = new CellConstraints(); PanelBuilder builder = new PanelBuilder(new FormLayout("fill:200dlu:grow", "pref, 3dlu, top:40dlu:grow")); builder.setDefaultDialogBorder(); builder.addLabel("Select actions for duplicated attributes:", cc.xy(1, 1)); builder.add(new JScrollPane(attributesTable), cc.xy(1, 3)); JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(proceedButton); getContentPane().setLayout(new BorderLayout()); getContentPane().add(builder.getPanel(), BorderLayout.CENTER); getContentPane().add(buttons, BorderLayout.SOUTH); // TODO: use preferences setSize(450, 350); }
public UpdateEdge(Edge edge, NetList netzListe, GraphView control) { super( netzListe.control.parent, "Updating Edge from node " + edge.from.getName() + " to " + edge.to.getName(), true); this.control = control; this.edge = edge; this.netzListe = netzListe; String cols = "5dlu, fill:pref:grow, 5dlu, fill:pref:grow, 5dlu"; String rows = "5dlu, fill:pref:grow, 5dlu, pref, 5dlu"; FormLayout layout = new FormLayout(cols, rows); getContentPane().setLayout(layout); CellConstraints cc = new CellConstraints(); tabbedPane.addTab("Weight & Anchor", getMainPanel()); tabbedPane.addTab("Further Attributes", getSubPanel()); getContentPane().add(tabbedPane, cc.xyw(1, 2, 5)); jbDelete.addActionListener(this); getContentPane().add(jbDelete, cc.xy(2, 4)); jb.addActionListener(this); getContentPane().add(jb, cc.xy(4, 4)); pack(); setSize(Math.max(this.getSize().width, 450), this.getSize().height); this.setLocation(300, 300); setVisible(true); }
private JPanel createComponent() { JPanel panel = PanelFactory.createDialogPanel("p, 4dlu, p", "p"); CellConstraints cc = new CellConstraints(); panel.add(combobox.getComponent(), cc.xy(1, 1)); panel.add( ButtonFactory.newCleanButton( ResourceUtility.getIcon("/uk/ac/ebi/chemet/render/images/cutout/browse_16x16.png"), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { int choice = chooser.showOpenDialog(component); if (choice == JFileChooser.APPROVE_OPTION) { File file = chooser.getSelectedFile(); try { Reconstruction reconstruction = ReconstructionIOHelper.read(file); DefaultReconstructionManager.getInstance().addReconstruction(reconstruction); combobox.refresh(); combobox.setSelected(reconstruction); } catch (IOException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } } } }, "Open a reconstruction from disk"), cc.xy(3, 1)); return panel; }
private JPanel buildChoicesPanel() { FormLayout layout = new FormLayout( "right:max(50dlu;pref), 3dlu, p, 6dlu, p, 6dlu, p, 0:grow", "p, 3dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.addSeparator("Integer Choice", cc.xyw(1, 1, 8)); builder.addLabel("JRadioButton", cc.xy(1, 3)); builder.add(leftIntRadio, cc.xy(3, 3)); builder.add(centerIntRadio, cc.xy(5, 3)); builder.add(rightIntRadio, cc.xy(7, 3)); builder.addLabel("JComboBox", cc.xy(1, 5)); builder.add(alignmentIntCombo, cc.xyw(3, 5, 3)); builder.addSeparator("Object Choice", cc.xyw(1, 7, 8)); builder.addLabel("JRadioButton", cc.xy(1, 9)); builder.add(leftObjectRadio, cc.xy(3, 9)); builder.add(centerObjectRadio, cc.xy(5, 9)); builder.add(rightObjectRadio, cc.xy(7, 9)); builder.addLabel("JComboBox", cc.xy(1, 11)); builder.add(alignmentObjectCombo, cc.xyw(3, 11, 3)); return builder.getPanel(); }
public VariableNameDialog(JFrame parent, String name) { super(parent, "R object name", true); setLocationRelativeTo(parent); this.parent = parent; String cols = "5dlu, pref, 5dlu, fill:pref:grow, 5dlu, pref, 5dlu"; String rows = "5dlu, pref, 5dlu, pref, 5dlu, pref, 5dlu, pref, 5dlu"; FormLayout layout = new FormLayout(cols, rows); getContentPane().setLayout(layout); CellConstraints cc = new CellConstraints(); int row = 2; jt.setText(name); jt.addActionListener(this); getContentPane().add(new JLabel("R object name:"), cc.xy(2, row)); getContentPane().add(jt, cc.xyw(4, row, 3)); row += 2; getContentPane().add(ok, cc.xy(6, row)); ok.addActionListener(this); actionPerformed(null); pack(); setVisible(true); }
private void layoutMainPanel() { FormLayout layout = new FormLayout( "right:d, $lcgap, 50dlu:g, 8dlu, right:d, $lcgap, max(65dlu;min)", "f:d, $nlgap, f:d, $nlgap, f:d"); layout.setRowGroups(new int[][] {{1, 3, 5}}); CellConstraints cc = new CellConstraints(); setLayout(layout); /* Create a sub panel to work around a column spanning problem in FormLayout */ JPanel subPanel = buildHorizontalSubPanel( "max(48dlu;min):g(0.5), 8dlu, d, $lcgap, max(48dlu;min):g(0.5)", ValidationFactory.wrap(priceField), "Label.Quantity", ValidationFactory.wrap(quantityField)); add("Label.Security", cc.xy(1, 1)); add(ValidationFactory.wrap(securityCombo), cc.xy(3, 1)); add("Label.Date", cc.xy(5, 1)); add(datePanel, cc.xy(7, 1)); add("Label.Price", cc.xy(1, 3)); add(subPanel, cc.xy(3, 3)); add("Label.Total", cc.xy(5, 3)); add(totalField, cc.xy(7, 3)); add("Label.Memo", cc.xy(1, 5)); add(memoField, cc.xy(3, 5)); add(getReconcileCheckBox(), cc.xyw(5, 5, 3)); }
@Override public JPanel createSettingsPanel() { EnhancedPanelBuilder pb = new EnhancedPanelBuilder("pref, 3dlu, 0dlu:grow"); pb.setDefaultDialogBorder(); CellConstraints cc1 = new CellConstraints(); CellConstraints cc2 = new CellConstraints(); // TODO NLS pb.addParagraph("Bong.tv Zugangsdaten"); pb.addRow(); // TODO NLS pb.add( new JLabel("Benutzer: "), cc1.xy(1, pb.getRowCount()), tfBenutzer, cc2.xy(3, pb.getRowCount())); pb.addRow(); // TODO NLS pb.add( new JLabel("Passwort: "), cc1.xy(1, pb.getRowCount()), tfPasswort, cc2.xy(3, pb.getRowCount())); // pb.nextLine(); // TODO NLS // pb.addSeparator("Von Bong.tv unterstützte Programme in Programmübersicht übernehmen?"); // pb.nextLine(); // pb.add(cbProgrammeUebernehmen); return pb.getPanel(); }
private int createArmSelect( PanelBuilder builder, int row, final Study curStudy, TreatmentDefinition def, CellConstraints cc) { builder.addLabel(def.getLabel(), cc.xy(2, row)); ListModel arms = d_pm.getArmsPerStudyPerDefinition(curStudy, def); final JComboBox drugBox = AuxComponentFactory.createBoundComboBox( arms, d_pm.getSelectedArmModel(curStudy, def), true); if (arms.getSize() == 1) drugBox.setEnabled(false); final JPanel drugAndDosePanel = new JPanel(new BorderLayout()); builder.add(drugBox, cc.xy(4, row)); drugBox.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { updateDrugAndDoseLabel(curStudy, drugBox, drugAndDosePanel); } }); row = LayoutUtil.addRow(builder.getLayout(), row); updateDrugAndDoseLabel(curStudy, drugBox, drugAndDosePanel); builder.add(drugAndDosePanel, cc.xy(4, row)); return LayoutUtil.addRow(builder.getLayout(), row); }
private JPanel buildMiscPanel() { FormLayout layout = new FormLayout( "right:max(50dlu;pref), 3dlu, 50dlu, 3dlu, 50dlu", "p, 3dlu, p, 3dlu, p, 3dlu, p"); layout.setRowGroups(new int[][] {{1, 3, 5}}); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); Action chooseAction = new ChooseColorAction( builder.getPanel(), presentationModel.getModel(ExampleBean.PROPERTYNAME_COLOR)); CellConstraints cc = new CellConstraints(); builder.addLabel("JCheckBox", cc.xy(1, 1)); builder.add(checkBox, cc.xy(3, 1)); builder.addLabel("JSlider", cc.xy(1, 3)); builder.add(slider, cc.xy(3, 3)); builder.add(floatLabel, cc.xy(5, 3)); builder.addLabel("JSpinner", cc.xy(1, 5)); builder.add(spinner, cc.xy(3, 5)); builder.addLabel("JColorChooser", cc.xy(1, 7)); builder.add(colorPreview, cc.xy(3, 7, "fill, fill")); builder.add(new JButton(chooseAction), cc.xy(5, 7, "left, center")); return builder.getPanel(); }
/** * Create file selection panel * * @return the panel */ private JPanel createSelectionPanel() { FormLayout layout = new FormLayout( "0dlu:n, pref:grow, 2dlu, pref:grow, 2dlu, pref:grow, 40dlu, 4dlu, min", "pref:grow, 6dlu, pref:grow, 6dlu, pref:grow"); JPanel sPanel = new JPanel(layout); CellConstraints cc = new CellConstraints(); // JLabel note = new JLabel("Choose by: "); // Font oldFont = note.getFont(); // Font newFont = new Font(oldFont.getName(), oldFont.getStyle(), oldFont.getSize() + 2); // note.setFont(newFont); sPanel.add(choosebyLabel, cc.xy(2, 1)); sPanel.add(dirRadio, cc.xy(4, 1)); sPanel.add(fileRadio, cc.xy(6, 1)); sPanel.add(srcFilesDirField, cc.xyw(2, 3, 6)); sPanel.add(srcFilesBrowseBtn, cc.xy(9, 3)); sPanel.add(selectedFileCountLabel, cc.xyw(2, 5, 6)); ButtonGroup selectGroup = new ButtonGroup(); selectGroup.add(fileRadio); selectGroup.add(dirRadio); sPanel.setBorder(BorderFactory.createTitledBorder("1. Choose source files")); return sPanel; }
private Component buildSettingsPanel() { FormLayout layout = new FormLayout( "right:pref, $lcgap, pref, 10dlu, right:pref, $lcgap, pref", "p, 3dlu, p, 7dlu, p, 3dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); builder.setOpaque(false); CellConstraints cc = new CellConstraints(); builder.addSeparator("Host", cc.xyw(1, 1, 7)); builder.addLabel("URI", cc.xy(1, 3)); builder.add(jtflHost, cc.xyw(3, 3, 5)); builder.addSeparator("User", cc.xyw(1, 5, 7)); builder.addLabel("Name", cc.xy(1, 7)); builder.add(jtflUser, cc.xy(3, 7)); builder.addLabel("Password", cc.xy(5, 7)); builder.add(jpflPwd, cc.xy(7, 7)); JPanel panel = builder.getPanel(); panel.setOpaque(false); return panel; }
private void jbInit() throws Exception { setOpaque(false); jpnlContent.setOpaque(false); FormLayout formLayout = new FormLayout( "5px, left:pref, 4dlu, 150dlu:grow, 5px", "5px, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 2dlu, pref, 5px"); jpnlContent.setLayout(formLayout); formLayout.setRowGroups(new int[][] {{2, 4, 6, 8, 10, 12}}); CellConstraints cc = new CellConstraints(); jpnlContent.add(jlblHostName, cc.xy(2, 2)); jpnlContent.add(jtfldHostName, cc.xy(4, 2)); jpnlContent.add(jlblUserName, cc.xy(2, 4)); jpnlContent.add(jtfldUserName, cc.xy(4, 4)); jpnlContent.add(jlblUserPass, cc.xy(2, 6)); jpnlContent.add(jtfldUserPass, cc.xy(4, 6)); jpnlContent.add(jlblFromEmail, cc.xy(2, 8)); jpnlContent.add(jtfldFromEmail, cc.xy(4, 8)); jpnlContent.add(jlblFromName, cc.xy(2, 10)); jpnlContent.add(jtfldFromName, cc.xy(4, 10)); jpnlContent.add(jchkbDebug, cc.xy(2, 12)); JPanel jpnlDummy = new JPanel(new BorderLayout()); jpnlDummy.add(jpnlContent, BorderLayout.NORTH); add(jpnlContent, BorderLayout.CENTER); }
/** * Creates group item. * * @param name name. * @param tooltip tooltip. * @param color1 first background color. * @param color2 second background color. */ public ResultGroupPanel(String name, String tooltip, Color color1, Color color2) { backgroundColor1 = color1; backgroundColor2 = color2; moreItem = new MoreItem(); lbCount = new JLabel("0"); setLayout(new FormLayout("5px, 10px, 5px, 50px:grow, 5px, 30px, 5px", "2px, p, 2px")); CellConstraints cc = new CellConstraints(); GroupCollapseIcon icon = new GroupCollapseIcon(); icon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); add(icon, cc.xy(2, 2)); Font fnt = new Font("Lucida Grande", Font.BOLD, 12); lbTitle = new JLabel(name); lbTitle.setFont(fnt); lbTitle.setForeground(Color.WHITE); lbCount.setFont(fnt); lbCount.setForeground(Color.WHITE); lbCount.setAlignmentX(0.5f); add(lbTitle, cc.xy(4, 2)); add(lbCount, cc.xy(6, 2)); setBackground(backgroundColor1); if (tooltip != null) setToolTipText(tooltip); }
/** * Adds fill components to empty cells in the first row and first column of the grid. This ensures * that the grid spacing will be the same as shown in the designer. * * @param cols an array of column indices in the first row where fill components should be added. * @param rows an array of row indices in the first column where fill components should be added. */ void addFillComponents(Container panel, int[] cols, int[] rows) { Dimension filler = new Dimension(10, 10); boolean filled_cell_11 = false; CellConstraints cc = new CellConstraints(); if (cols.length > 0 && rows.length > 0) { if (cols[0] == 1 && rows[0] == 1) { /** add a rigid area */ panel.add(Box.createRigidArea(filler), cc.xy(1, 1)); filled_cell_11 = true; } } for (int index = 0; index < cols.length; index++) { if (cols[index] == 1 && filled_cell_11) { continue; } panel.add(Box.createRigidArea(filler), cc.xy(cols[index], 1)); } for (int index = 0; index < rows.length; index++) { if (rows[index] == 1 && filled_cell_11) { continue; } panel.add(Box.createRigidArea(filler), cc.xy(1, rows[index])); } }
private JPanel pracownikPanel() { FormLayout layout3 = new FormLayout("734", "15px, 485px"); pracownikPanel = new JPanel(layout3); // pracownikPanel= new FormDebugPanel(layout3); CellConstraints cc = new CellConstraints(); JLabel labell = new JLabel("Wyloguj"); labell.addMouseListener( new MouseAdapter() { public void mousePressed(MouseEvent me) { CardLayout c1 = (CardLayout) (utworzPanel.getLayout()); c1.show(utworzPanel, "card1"); tx1.setText(""); tx2.setText(""); } }); Color c = new Color(153, 180, 209); pracownikPanel.setBackground(c); tabbedPane2 = new JTabbedPane(JTabbedPane.LEFT); tabbedPane2.setBorder(null); tabbedPane2.addTab("Raport", new ImageIcon("images/spotkania.png"), new Raport()); Font font = new Font("Arial", Font.BOLD, 15); tabbedPane2.setFont(font); tabbedPane2.setBackground(c); pracownikPanel.add(tabbedPane2, cc.xy(1, 2)); pracownikPanel.add(labell, cc.xy(1, 1, CellConstraints.RIGHT, CellConstraints.TOP)); return pracownikPanel; }
public Gutachten() { super(); // gutachten = this; setOpaque(false); setLayout(new BorderLayout()); /** ******zuerst das Leere Panel basteln************* */ leerPanel = new KeinRezept("noch keine Gutachten angelegt für diesen Patient"); leerPanel.setName("leerpanel"); leerPanel.setOpaque(false); /** ******dann das volle************* */ JXPanel allesrein = new JXPanel(new BorderLayout()); allesrein.setOpaque(false); allesrein.setBorder(null); FormLayout lay = new FormLayout("5dlu,fill:0:grow(1.00),0dlu", "0dlu,p,2dlu,p,2dlu,fill:0:grow(1.00),5dlu"); CellConstraints cc = new CellConstraints(); allesrein.setLayout(lay); wechselPanel = new JXPanel(new BorderLayout()); wechselPanel.setOpaque(false); wechselPanel.setBorder(null); wechselPanel.add(leerPanel, BorderLayout.CENTER); aktPanel = "leerPanel"; allesrein.add(getToolbar(), cc.xy(2, 2)); // allesrein.add(getTabelle(),cc.xy(2, 4)); allesrein.add(wechselPanel, cc.xy(2, 6)); add(JCompTools.getTransparentScrollPane(allesrein), BorderLayout.CENTER); validate(); new Thread() { public void run() { new SwingWorker<Void, Void>() { @Override protected Void doInBackground() throws Exception { // TODO Auto-generated method stub vollPanel = new JXPanel(); FormLayout vplay = new FormLayout("5dlu,fill:0:grow(1.00),5dlu", "13dlu,fill:0:grow(1.00),5dlu"); // FormLayout vplay = new // FormLayout("5dlu,fill:0:grow(1.00),5dlu","5dlu,fill:0:grow(1.00),5dlu"); CellConstraints vpcc = new CellConstraints(); vollPanel.setLayout(vplay); vollPanel.setOpaque(false); vollPanel.setBorder(null); anzahlGutachten = new JLabel("Anzahl sozialmed. Gutachten: 0"); vollPanel.add(anzahlGutachten, vpcc.xy(2, 1)); vollPanel.add(getGutachtenTbl(), vpcc.xy(2, 2)); return null; } }.execute(); } }.start(); }
/** * Adds a new row to this object's content area. * * @param cc the cell constraints of the new row * @param labelStr the text label for the new row * @param column the starting column number for the new row's UI * @param row the row number of the new row * @return the {@link JTextField} added to the new row */ protected JTextField addRow( final CellConstraints cc, final String labelStr, final int column, final int row) { add(createI18NFormLabel(labelStr), cc.xy(column, row)); // $NON-NLS-1$ JTextField tf = createTextField(); tf.setEditable(false); add(tf, cc.xy(column + 2, row)); return tf; }
private void initLayout() { setBorder(Borders.createEmptyBorder(ComponentFactoryService.DEFAULT_FORM_BORDER)); setLayout(new FormLayout("pref, 3dlu, pref", "pref")); final CellConstraints cellConstraints = new CellConstraints(); add(insetLabel, cellConstraints.xy(1, 1)); add(insetSpinner, cellConstraints.xy(3, 1)); }
private JXPanel getContent() { FormLayout lay = new FormLayout("fill:0:grow(0.5),fill:0:grow(0.5)", "fill:0:grow(1.0)"); CellConstraints cc = new CellConstraints(); content = new JXPanel(); content.setLayout(lay); content.add(getButtonTeil(), cc.xy(1, 1)); content.add(getTreeTableTeil(), cc.xy(2, 1)); content.validate(); return content; }
protected JComponent buildFilterPanel() { FormLayout layout = new FormLayout("40dlu,3dlu,f:p:g,3dlu,p", "f:p"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.addLabel("Filtrar: ", cc.xy(1, 1)); builder.add(inputField, cc.xy(3, 1)); builder.add(loadBtn, cc.xy(5, 1)); // builder.setDefaultDialogBorder(); return builder.getPanel(); }
/** Constructs a JPanel containing a label and a JTextField */ private JPanel makePanelFrom(final String label, final JTextField textField) { final FormLayout fl = new FormLayout("pref, 3dlu, pref", "pref"); final PanelBuilder builder = new PanelBuilder(fl); final CellConstraints cc = new CellConstraints(); builder.addLabel(label, cc.xy(1, 1)); builder.add(textField, cc.xy(3, 1)); return builder.getPanel(); }
protected JComponent createMainPanel() { final FormLayout layout = new FormLayout("max(p;380dlu)", "p,3dlu,220dlu,3dlu,50dlu"); CellConstraints cc = new CellConstraints(); PanelBuilder builder = new PanelBuilder(layout); builder.add(createMasterPanel(), cc.xy(1, 1)); builder.add(createDetailsPanel(), cc.xy(1, 3)); builder.add(createValidationView(), cc.xy(1, 5)); // model.updateValidation(); updateComponentTreeMandatoryAndSeverity( model.getValidationModel().getResult(), builder.getPanel()); return builder.getPanel(); }
private Component buildMainPanel() { FormLayout layout = new FormLayout("center:pref", "p, 10dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); builder.setOpaque(false); CellConstraints cc = new CellConstraints(); builder.add(buildSettingsPanel(), cc.xy(1, 1)); builder.add(buildButtonsPanel(), cc.xy(1, 3)); return builder.getPanel(); }
public JPanel buildPanel(WindowInterface window) { initComponents(window); FormLayout layout = new FormLayout("p", "240dlu,3dlu,p"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(new JScrollPane(tableCommission), cc.xy(1, 1)); builder.add(ButtonBarFactory.buildCenteredBar(buttonExcel), cc.xy(1, 3)); JPanel panel = builder.getPanel(); panel.addComponentListener(viewHandler.getClaimComponentListener(window)); return panel; }
@Override public JComponent createForm() { JComponent component = super.createForm(); annotationComboBox.setRenderer( new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (value != null) { Annotation annotation = (Annotation) value; this.setText(annotation.getBrief()); } else { this.setText("-- select annotation --"); } return this; } }); component.setLayout(new FormLayout("right:p, 4dlu, left:p", "p, 4dlu, p, 4dlu, p, 4dlu, p")); CellConstraints cc = new CellConstraints(); component.add(getLabel("annotationLabel"), cc.xy(1, 1)); component.add(annotationComboBox, cc.xy(3, 1)); component.add(getLabel("patternLabel"), cc.xy(1, 3)); component.add(patternField, cc.xy(3, 3)); component.add(getLabel("ciLabel"), cc.xy(1, 5)); component.add(caseInsensitive, cc.xy(3, 5)); component.add(getLabel("remove"), cc.xy(1, 7)); component.add(removeMatched, cc.xy(3, 7)); patternField.setEnabled(false); caseInsensitive.setSelected(true); caseInsensitive.setEnabled(false); // action listener will fill out a suggested pattern for selected annotation types annotationComboBox.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Object obj = annotationComboBox.getSelectedItem(); if (obj == null) { patternField.setEnabled(false); caseInsensitive.setEnabled(false); setEnabled(false); } else { patternField.setEnabled(true); caseInsensitive.setEnabled(true); patternField.setText(getDefault(obj.getClass())); patternField.setCaretPosition(0); setEnabled(true); } } }); return component; }
private JPanel logowaniePanel() { FormLayout layout3 = new FormLayout( "245px, 29px, 64px, 10px, 75px, 10px, 19px, 36px, 246px", "159px, 35px, 15px, 35px, 10px, 35px, 37px, 155px"); // musi byc 500px logowaniePanel = new JPanel(layout3); // logowaniePanel = new FormDebugPanel(layout3); CellConstraints cc = new CellConstraints(); Color c = new Color(153, 180, 209); logowaniePanel.setBackground(c); JLabel label = new JLabel("LOGOWANIE"); Font font = new Font("Arial", Font.BOLD, 34); Font font2 = new Font("Arial", Font.PLAIN, 16); label.setFont(font); JLabel l1 = new JLabel("Login: "******"Hasło: ", JLabel.TRAILING); l2.setFont(font2); tx1 = new JTextField(); tx2 = new JPasswordField(); buttonOK = new JButton("ok"); buttonOK.setPreferredSize(new Dimension(55, 37)); buttonOK.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String password = new String(tx2.getText()); if (tx1.getText().equals("admin") && password.equals("admin")) { CardLayout c1 = (CardLayout) (utworzPanel.getLayout()); c1.show(utworzPanel, "card2"); } else if (tx1.getText().equals("kibic") && password.equals("kibic")) { CardLayout c1 = (CardLayout) (utworzPanel.getLayout()); c1.show(utworzPanel, "card3"); } else if (tx1.getText().equals("pracownik") && password.equals("pracownik")) { CardLayout c1 = (CardLayout) (utworzPanel.getLayout()); c1.show(utworzPanel, "card4"); } } }); logowaniePanel.add(label, cc.xyw(2, 2, 7, CellConstraints.CENTER, CellConstraints.CENTER)); logowaniePanel.add(l1, cc.xy(3, 4)); logowaniePanel.add(l2, cc.xy(3, 6)); logowaniePanel.add(tx1, cc.xy(5, 4, CellConstraints.FILL, CellConstraints.FILL)); logowaniePanel.add(tx2, cc.xy(5, 6, CellConstraints.FILL, CellConstraints.FILL)); logowaniePanel.add(buttonOK, cc.xyw(7, 7, 2)); return logowaniePanel; }