C'è un modo per aggiungere 0 margine/riempimento a un JPanel in modo che si adatti alla schermata WHOLE che si suppone?0 margine superiore su JPanel
Ecco cosa sto parlando: (? Vedi il poco spazio sopra il pannello perché non si copre anche quello?)
Ecco il modo in cui è messa a punto:
labelStatus = new JLabel("\n\nSorry, the server crashed!");
labelStatus.setForeground(Color.WHITE.brighter());
statusPanel = new JPanel();
statusPanel.setBackground(Color.RED.darker());
statusPanel.add(labelStatus);
statusPanel.setPreferredSize(new Dimension(513,352));
e questo è come viene iniated:
} catch (Exception rwe) {
// System.exit(0);
game.add(statusPanel);
game.remove(yPanel);
game.remove(xPanel);
game.remove(roomPanel);
game.remove(userPanel);
game.remove(titlePanel);
game.remove(introPanel);
statusPanel.setOpaque(true);
labelStatus.setVisible(true);
System.out.println("Server went down -- crap!");
c.append("\nServer crashed!");
rwe.printStackTrace();
}
Quindi .. come posso risolvere quel piccolo gap?