Hello all,
I am using a JMenuBar with a lot of menus and what bugs me is the bar. I would rather it be slightly transparent. So far I have tried to extend JMenuBar and override the paintComponent and paint methods.
protected void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.2f));
super.setOpaque(false);
super.paintComponent(g2);
}
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,0.2f));
super.setOpaque(false);
super.paint(g2);
}
So far all i've managed to do is make the menu titles transparent I still can't figure out how to actually make the JMenuBar transparent. I have tried setting opaque(false) that doesn't seem to work either. Any help would be great thanks. :)