JWindow on the desktop

L

Lee

Does anyone know how I can get a JWindow to sit on the desktop and always be
at the bottom of all the windows? I've tried jwindow.toBack() but it seems
to disappear altogether.
 
L

Lee

toBack() doesn't work on this:

public DesktopPanel()
{

Dimension screenSize =
Toolkit.getDefaultToolkit().getScreenSize();

JPanel j = new JPanel();
j.setBorder(new LineBorder(Color.blue));

setSize((int)(screenSize.getWidth()), 22);
setLocation(0,(int)(screenSize.getHeight())-100);

setContentPane(frameContent);
frameContent.setBackground(new java.awt.Color(58,58,58));
frameContent.setLayout(new BorderLayout());

addMouseMotionListener(this);
addMouseListener(this);

JButton quitButton = new JButton("X");
quitButton.setSize(20,20);
quitButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(99);
}
});


JLabel west=null;
try{
west = new JLabel(new ImageIcon("logo.gif"));
}catch(Exception gh){gh.printStackTrace();}

frameContent.setBorder(new LineBorder(new java.awt.Color(189,189,255)));
frameContent.add(west, BorderLayout.WEST);
frameContent.add(quitButton,BorderLayout.EAST);

setVisible(true);
toBack();

}
 
A

Andrew Thompson

On Wed, 06 Oct 2004 15:39:46 GMT, Lee wrote:

Please refrain from top-posting Lee, I find it most
confusing, and so, apparently, do you.
...
toBack() doesn't work on this:

public DesktopPanel()

It is no wonder you are having problems. That does not compile.

Which part of 'self contained' are you having a problem with?

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top