how to change the color of a menubar in java
public class BackgroundMenuBar extends JMenuBar {
Color bgColor=Color.WHITE;
public void setColor(Color color) {
bgColor=color;
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(bgColor);
g2d.fillRect(0, 0, getWidth() - 1, getHeight() - 1);
}
}
Also in Java:
- How to draw Bezier Curve in Android
- how to scan a character in java
- java valeur absolue
- android studio keep device awake
- how to do for each in java
- how to create a draw Rectangle in java
- how to minimize jframe in java
- Linked List implementation
- java how to serialize a file into a local server
- print arraylist java
- classes in java
- change brightness of image in java
- fibonacci sequence in java recursion
- java string is null or empty
- java split array into two
- count the number of words in a string java
- java shortest if else statement
- java convert string with commas to long
- java loop
- java create file
- android studio clear views of layout
- java check if file exists
- vector in java
- web app runtime for java