- All Superinterfaces:
- EventListener
- All Known Implementing Classes:
- AWTEventMulticaster, BasicToolBarUI.FrameListener, JMenu.WinListener, WindowAdapter
- See Also:
- Top Examples, Source Code,
WindowEvent
void windowActivated(WindowEvent e)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1742]windowListener
By kujini2000 { at } nate { dot } com on 2006/04/06 22:48:29 Rate
I wnat to know about WindowsListener.
void windowClosed(WindowEvent e)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void windowClosing(WindowEvent e)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[1395]Cross Platform Look And Feel
By suseelalachireddy on 2005/04/17 18:30:21 Rate
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.UIManager;
class frame extends JFrame {
JFrame f;
frame ( ) throws Exception
{
// UIManager.setLookAndFeel ( "com.sun.java.swing.motif.MotifLookAndFeel" ) ;
UIManager.setLookAndFeel ( UIManager.getCrossPlatformLookAndFeelClassName ( ) ) ;
// JFrame.setDefaultLookAndFeelDecorated ( true ) ;
f=new JFrame ( "My Frame" ) ; //Title for the Frame
Container c=this.getContentPane ( ) ; //default contentPane
f.setContentPane ( c ) ;
f.setSize ( 100,100 ) ; //setSize is used specify the size of the Frame , it accepts width and height as parameters
f.setVisible ( true ) ; // setVisible function is used to display the Frame ,
//It accepts a boolean value ,if the boolean value is false , then the Frame is invisible
f.show ( ) ; //same as setVisible ( )
f.pack ( ) ; //finalizes the layout
f.addWindowListener ( new WindowAdapter ( )
{
public void windowClosing ( WindowEvent e )
{
f.dispose ( ) ;
}
} ) ;
//f.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE ) ;
//f.setDefaultCloseOperation ( JFrame.DO_NOTHING_ON_CLOSE ) ;
f.setTitle ( "My New Title" ) ;
f.setResizable ( true ) ;
c.setBackground ( Color.red ) ;
//c.setForeground ( Color.black ) ;
}
public static void main ( String args [ ] ) throws Exception
{
frame f=new frame ( ) ;
}
}
void windowDeactivated(WindowEvent e)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void windowDeiconified(WindowEvent e)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void windowIconified(WindowEvent e)
- See Also:
Frame.setIconImage(java.awt.Image)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
void windowOpened(WindowEvent e)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples