import java.awt.*;
import com.sun.java.swing.*;
public class Test
{
public static void main(String argv[])
{
JFrame frame = new JFrame();
frame.setSize(300, 300);
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu("File");
menuBar.add(menu);
frame.setJMenuBar(menuBar);
frame.setBackground(Color.lightGray);
frame.getContentPane().add(new JTextArea());
frame.show();
}
}
If I does not add a JTextArea to frame, then the color of JMenuBar
will always be light gray. Is the above problem a bug of swing? Or,
Is there other correct method to set color of JMenuBar?
Dong-Yueh Liu
email: dy...@ms1.hinet.net