Java Utililty Methods JPanel Child

List of utility methods to do JPanel Child

Description

The list of methods to do JPanel Child are organized into topic(s).

Method

voidremovePanel(JPanel parent, JPanel panel)
remove Panel
parent.remove(panel);
voidresetControlsInAPanel(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) {
...
voidresizeJPanel(JPanel p)
Resize the panel correctly, based on size of things in it.
Dimension d = p.getLayout().preferredLayoutSize(p);
p.setPreferredSize(d);
voidunmaskContainer(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);
...
JPanelwrapInMinimizer(JPanel panel)
wrap In Minimizer
JPanel result = new JPanel();
result.setLayout(new BorderLayout());
result.add(panel, BorderLayout.WEST);
return result;
JPanelwrapMacFancy(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);
...