List of utility methods to do JPanel Child
void | removePanel(JPanel parent, JPanel panel) remove Panel parent.remove(panel); |
void | resetControlsInAPanel(JPanel panel) reset Controls In A Panel for (Component cmp : panel.getComponents()) { if (cmp instanceof JTextField) { ((JTextField) cmp).setText(""); if (cmp instanceof JTextArea) { ((JTextArea) cmp).setText(""); if (cmp instanceof JComboBox) { ... |
void | resizeJPanel(JPanel p) Resize the panel correctly, based on size of things in it. Dimension d = p.getLayout().preferredLayoutSize(p); p.setPreferredSize(d); |
void | unmaskContainer(JPanel pnl) unmask Container WindowConstants container = getOutermostContainer(pnl); if (container == null) { return; if (container instanceof JDialog) { unmaskWindow((JDialog) container); } else if (container instanceof JFrame) { unmaskWindow((JFrame) container); ... |
JPanel | wrapInMinimizer(JPanel panel) wrap In Minimizer JPanel result = new JPanel(); result.setLayout(new BorderLayout()); result.add(panel, BorderLayout.WEST); return result; |
JPanel | wrapMacFancy(JPanel content) wrap Mac Fancy JPanel panel = new JPanel(new BorderLayout()) { private static final long serialVersionUID = 941275105778632480L; @Override public void paintComponent(Graphics g) { Color border = new Color(64, 64, 64, 64); Color bg = new Color(128, 128, 128, 64); Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); ... |