private JPanel createTableHeader(JLabel label) { JPanel headerPanel = new JPanel(new BorderLayout()); headerPanel.add(label, BorderLayout.NORTH); headerPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(TangoColorFactory.ALUMINIUM_5), BorderFactory.createEmptyBorder(2, 2, 2, 2))); return headerPanel; }
public MrMachinePanel(MachineReassignmentPanel machineReassignmentPanel, List<MrResource> resourceList, MrMachine machine) { super(new BorderLayout()); this.machineReassignmentPanel = machineReassignmentPanel; this.resourceList = resourceList; this.machine = machine; setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder(1, 2, 1, 2), BorderFactory.createLineBorder(Color.BLACK)), BorderFactory.createEmptyBorder(1, 1, 1, 1))); createUI(); }
public void newGroup(String name, boolean withBorder) { currentPanel = new JPanel(); if (withBorder) { currentPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder(name), BorderFactory.createEmptyBorder(0,0,0,0))); } // using GridBagLayout because it allows for 2 columns with different widths currentLayout = new GridBagLayout(); currentConstraints = new GridBagConstraints(); currentConstraints.anchor = GridBagConstraints.WEST; currentConstraints.fill = GridBagConstraints.HORIZONTAL; currentConstraints.weightx = 1.0; currentConstraints.weighty = 1.0; currentConstraints.insets = new Insets(0, 3, 0, 3); currentConstraints.gridy = -1; currentPanel.setLayout(currentLayout); add(currentPanel); }
private void init() { JTextArea errorArea = new JTextArea(); errorArea.setEditable(false); errorArea.setText(exc.getMessage() + "\n"); getContentPane().setLayout(new BorderLayout()); JPanel messagePanel = new JPanel(new BorderLayout()); messagePanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(), BorderFactory .createTitledBorder(BorderFactory.createEtchedBorder(), NLS.nls("COMPILE_ERROR.PANEL.TITLE")))); messagePanel.add(new JScrollPane(errorArea), BorderLayout.CENTER); getContentPane().add(messagePanel, BorderLayout.CENTER); JPanel btnPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); okBtn = new JButton(NLS.nls("COMPILE_ERROR.OK_BUTTON.CAPTION")); okBtn.addActionListener(this); btnPane.add(okBtn); getRootPane().setDefaultButton(okBtn); getContentPane().add(btnPane, BorderLayout.SOUTH); pack(); setLocationRelativeTo(getParent()); setVisible(true); }
public CloudComputerPanel(CloudBalancingPanel cloudBalancingPanel, CloudComputer computer) { super(new GridLayout(0, 5)); this.cloudBalancingPanel = cloudBalancingPanel; this.computer = computer; setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder(1, 2, 1, 2), BorderFactory.createLineBorder(Color.BLACK)), BorderFactory.createEmptyBorder(1, 1, 1, 1))); createTotalsUI(); createBarsUI(); }
private JPanel createAdvancedPanel() { JPanel advancedPanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); CompoundBorder border = BorderFactory.createCompoundBorder(new EtchedBorder(), new EmptyBorder(10, 10, 10, 10)); advancedPanel.setBorder(border);
@Override public void onViewInit() { this.setBackground(AppThemeColor.TRANSPARENT); this.setOpacity(this.applicationConfig.get().getMaxOpacity() / 100f); this.setPreferredSize(new Dimension((int) (300 * this.componentsFactory.getScale()), (int) (150 * this.componentsFactory.getScale()))); JPanel root = this.componentsFactory.getJPanel(new BorderLayout(), AppThemeColor.FRAME); root.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(AppThemeColor.BORDER, 1), BorderFactory.createLineBorder(AppThemeColor.TRANSPARENT, 2))); root.add(this.getChatPanel(), BorderLayout.CENTER); this.add(root, BorderLayout.CENTER); this.pack(); }
private JPanel createTableHeader(JLabel label) { JPanel headerPanel = new JPanel(new BorderLayout()); headerPanel.add(label, BorderLayout.NORTH); headerPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(TangoColorFactory.ALUMINIUM_5), BorderFactory.createEmptyBorder(2, 2, 2, 2))); return headerPanel; }
public EmployeePanel(NurseRosteringPanel nurseRosteringPanel, List<ShiftDate> shiftDateList, List<Shift> shiftList, Employee employee) { super(new BorderLayout()); this.nurseRosteringPanel = nurseRosteringPanel; this.shiftDateList = shiftDateList; this.shiftList = shiftList; this.employee = employee; setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder(1, 2, 1, 2), BorderFactory.createLineBorder(Color.BLACK)), BorderFactory.createEmptyBorder(1, 1, 1, 1))); createUI(); }
JPanel tablePanel = new JPanel(new GridLayout(0, edgeLength)); tablePanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder(5, 5, 5, 5), BorderFactory.createTitledBorder("Table " + table.getTableIndex()) )); seatPanelMap.put(seat, seatPanel); } else { tablePanel.add(new JPanel());
public SplashScreen(final String image, final String text) { final JPanel contentPane = new JPanel(); contentPane.setLayout(new BorderLayout()); final Border bd1 = BorderFactory.createBevelBorder(BevelBorder.RAISED); final Border bd2 = BorderFactory.createEtchedBorder(); final Border bd3 = BorderFactory.createCompoundBorder(bd1, bd2); contentPane.setBorder(bd3); final ImageIcon icon = new ImageIcon(image); contentPane.add("North", new JLabel(" ", SwingConstants.CENTER)); contentPane.add("Center", new JLabel(icon, SwingConstants.CENTER)); contentPane.add("South", new JLabel(text, SwingConstants.CENTER)); setContentPane(contentPane); }
/** * Add name and value labels. * * @param c Component. * @param name Name. * @param val Value. * @param border Border. */ private void addAboutItem(JComponent c, String name, Object val, Border border) { String v = val != null ? val.toString() : "n/a"; String tip = String.format("<html><b>%s</b> ➯ %s</html>", name, val); JLabel lb = new JLabel(name); lb.setToolTipText(tip); JLabel field = new JLabel(v); field.setOpaque(true); field.setBackground(Color.WHITE); field.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(VALUE_BORDER_COLOR, 1), BorderFactory.createEmptyBorder(0, 3, 0, 3))); field.setToolTipText(tip); if (border != null) field.setBorder(border); c.add(lb, gbcLicenseLabel()); c.add(field, gbcLicenseField()); }
/** * Creates a panel with a titled border. * * @param title The title of the panel. * @return The created JPanel. */ protected JPanel createTitledPanel(String title) { JPanel panel = new JPanel(new GridBagLayout()); Border titleBorder = BorderFactory.createTitledBorder(title); panel.setBorder(BorderFactory.createCompoundBorder(titleBorder, PADDING)); return panel; }
private JPanel createTableHeader(JLabel label) { JPanel headerPanel = new JPanel(new BorderLayout()); headerPanel.add(label, BorderLayout.NORTH); headerPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(TangoColorFactory.ALUMINIUM_5), BorderFactory.createEmptyBorder(2, 2, 2, 2))); return headerPanel; }
public SeatPanel(Seat seat) { setLayout(new BorderLayout(5, 0)); setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(Color.DARK_GRAY), BorderFactory.createEmptyBorder(2, 2, 2, 2))); SeatDesignation dummySeatDesignation = new SeatDesignation(); dummySeatDesignation.setGuest(null); dummySeatDesignation.setSeat(seat); setSeatDesignation(dummySeatDesignation); }
add(button); } else { JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(TangoColorFactory.ALUMINIUM_6), BorderFactory.createEmptyBorder(5, 5, 5, 5))); Color background = (((row + column) % 2) == 0) ? Color.WHITE : TangoColorFactory.ALUMINIUM_3; panel.setBackground(background);
/** * Create a table with the <code>title</code> and the <code>model</code> to display. * * @param title Title to be used for this table. * @param model data to be displayed */ public DoubleDataMapTable(String title, DoubleDataMapModel model) { super(); this.setModel(model); this.setLayout(new GridBagLayout()); this.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder(title), BorderFactory.createEmptyBorder(0,0,0,0))); }
private JPanel createHeaderPanel(JLabel label) { JPanel headerPanel = new JPanel(new BorderLayout()); headerPanel.add(label, BorderLayout.NORTH); headerPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(TangoColorFactory.ALUMINIUM_5), BorderFactory.createEmptyBorder(2, 2, 2, 2))); return headerPanel; }
public AbstractManagerList(String nameFile) { this.setLayout(new BorderLayout()); try { InputStream in = AbstractManagerList.class.getResourceAsStream("/com/jsql/view/swing/resources/list/"+ nameFile); String line; BufferedReader reader = new BufferedReader(new InputStreamReader(in)); while ((line = reader.readLine()) != null) { this.itemsList.add(new ItemList(line)); } reader.close(); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } this.listFile = new DnDList(this.itemsList); this.listFile.setBorder(BorderFactory.createEmptyBorder(0, 0, LightScrollPane.THUMB_SIZE, 0)); this.add(new LightScrollPane(1, 0, 0, 0, this.listFile), BorderLayout.CENTER); this.lastLine.setOpaque(false); this.lastLine.setLayout(new BoxLayout(this.lastLine, BoxLayout.X_AXIS)); this.lastLine.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createMatteBorder(0, 0, 0, 0, HelperUi.COLOR_COMPONENT_BORDER), BorderFactory.createEmptyBorder(1, 0, 1, 1) ) ); }
@Override public JPanel createControlPanel() { JPanel panel = new JPanel(); panel.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createMatteBorder(0, 0, 1, 0, Color.BLACK), BorderFactory.createEmptyBorder(MARGIN, MARGIN, MARGIN, MARGIN))); String text = String.format("<html>%s</html>", message); int w = DEFAULT_WIDTH - 2 * MARGIN; Dimension dim = DialogUtils.getHtmlLabelTextExtent(text, w, true); JLabel label = new JLabel(text); label.setPreferredSize(dim); panel.add(label); panel.setPreferredSize(new Dimension(DEFAULT_WIDTH, dim.height + 4 * MARGIN)); return panel; }