Hi guys,

At the minute, I'm writing a simple Java application under Lucid Lynx, the latest and greatest Ubuntu release :)

Can anyone tell me how to make the windows in my application, match the look and feel of the other windows in the system?

I've tried setting the default look and feel to the system look and feel, but it doesn't work. I'm using the "New Wave" theme in Lucid, and all the windows have a grey top border, and grey menu bars. My application's windows have the grey top border but they don't have the grey menu bars. Instead, the menu bars have a white background, and the font is different as well.

I'm using Swing to develop the application. Can anyone tell me what I'm doing wrong? If someone here is running Linux, could they perhaps run my code and then change it accordingly so the window looks like all the other windows on my system?

Thanks for any help you can offer,
Demi

import javax.swing.*;

public class Window extends JFrame{

	private JMenuBar menuBar;
	private JMenu file, edit;


	public static void main(String [] args){
		new Window();
	}	

	public Window(){

		menuBar = new JMenuBar();

		file = new JMenu("File");
		edit = new JMenu("Edit");
		
		menuBar.add(file);
		menuBar.add(edit);

		this.setJMenuBar(menuBar);

		this.setSize(500,500);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);	
		this.setVisible(true);
	}
}

You'll have to create your own LAF to match the one your OS is using.
Java doesn't use the native GUI libraries from your operating system, so can't know what your operating system's LAF is. The Linux LAF is based on one way a Linux GUI may look that was almost standard when that LAF was created.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.