Methods Summary |
---|
public void | actionPerformed(java.awt.event.ActionEvent evt)
if(bottom.isVisible()) {
switchToMini();
} else {
switchToNormal();
}
|
public static void | main(java.lang.String[] args)
MiniMizeHack mini = new MiniMizeHack();
mini.frame.pack();
mini.frame.setSize(300,300);
mini.frame.setVisible(true);
|
private void | maybeShowPopup(java.awt.event.MouseEvent e)
if (e.isPopupTrigger()) {
popup.show(e.getComponent(),
e.getX(), e.getY());
}
|
public void | mouseClicked(java.awt.event.MouseEvent e)
|
public void | mouseEntered(java.awt.event.MouseEvent e)
|
public void | mouseExited(java.awt.event.MouseEvent e)
|
public void | mousePressed(java.awt.event.MouseEvent e)
maybeShowPopup(e);
|
public void | mouseReleased(java.awt.event.MouseEvent e)
maybeShowPopup(e);
|
public void | switchToMini()
// nuke the old frame and build a new one
Point location = frame.getLocation();
normal_size = frame.getSize();
frame.setVisible(false);
frame = new JFrame();
frame.setUndecorated(true);
frame.getContentPane().add(panel);
// hide the extra components
bottom.hide();
// add the popup
panel.addMouseListener(this);
// stay on top
//frame.setAlwaysOnTop(true);
// show the frame again
frame.pack();
//frame.setSize(100,100);
frame.setLocation(location);
frame.setVisible(true);
|
public void | switchToNormal()
// nuke the old frame and build a new one
Point location = frame.getLocation();
frame.setVisible(false);
frame = new JFrame();
frame.setUndecorated(false);
frame.getContentPane().add(panel);
// show the extra components
bottom.show();
frame.setJMenuBar(menubar);
// hide the popup
panel.removeMouseListener(this);
// turn off stay on top
//frame.setAlwaysOnTop(false);
// show the frame again
frame.pack();
frame.setSize(normal_size);
frame.setLocation(location);
frame.setVisible(true);
|