3. • setIconImage(ImageIcon.getImage())
• setExtendedState(int) //state constant
• setCursor(Cursor)
• add(component)
• void setJMenuBar(JMenuBar)
• void setDefaultCloseOperation(int)
• int getDefaultCloseOperation()
Default Close Constants
• DO_NOTHING_ON_CLOSE
• HIDE_ON_CLOSE //Default for JDialog and JFrame
• DISPOSE_ON_CLOSE //removes window from screen and frees up any resources used by it
• EXIT_ON_CLOSE //Exits the application, using System.exit(0)
GUI Components JFrame
Instructor: Tanzila Kehkashan
3
9. • void setVisible(boolean)
• void setVerticalTextPosition(int)
• int getVerticalTextPosition()
• void setHorizontalTextPosition(int)
• int getHorizontalTextPosition()
Horizontal position constants
• LEFT
• CENTER
• RIGHT
Vertical position constants
• TOP
• CENTER
• BOTTOM
GUI Components JFrame JLabel
Instructor: Tanzila Kehkashan
9