Is that possible. I tried setting opacity of the Jframe and set background but it didn't work out. Is there some easy and elegant way?
Asked
Active
Viewed 104 times
1 Answers
1
You can achieve this by setting the JFrame’s glassPane to a visible JPanel with a translucent background:
static void setDimmed(JFrame frame,
boolean dimmed) {
JComponent newGlassPane = new JPanel();
if (dimmed) {
newGlassPane.setBackground(new Color(0x80000000, true));
}
frame.setGlassPane(newGlassPane);
newGlassPane.setVisible(dimmed);
}

VGR
- 40,506
- 4
- 48
- 63