And if there are any other ways to do it, I would welcome the suggestions. I am also open to any other suggestions not pertaining to the problem, as long as they aren't against the forum rules.
This is the current, simple, code for the dock. It does nothing but show the dock and have a close button.
public class Main {
private JWindow gui;
private JButton exitButton;
/** Creates a new instance of Main */
public Main() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getDefaultScreenDevice();
GraphicsConfiguration gc = gd.getDefaultConfiguration();
int availableHeight = (int)(gc.getBounds().getHeight()) - Toolkit.getDefaultToolkit().getScreenInsets(gc).bottom;
gui = new JWindow();
exitButton = new JButton("Close");
exitButton.addActionListener(new CloseListener());
gui.getContentPane().add(exitButton, BorderLayout.PAGE_END);
gui.setBackground(Color.DARK_GRAY);
gui.setLocation(0,0);
gui.setSize(100, availableHeight);
gui.setVisible(true);
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Main prog = new Main();
}
private class CloseListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
}
}
Thank you very much for any help anyone can provide.

New Topic/Question
Reply



MultiQuote




|