Results 1 to 3 of 3

Thread: frames

  1. #1
    giorgi is offline Member
    Join Date
    Apr 2011
    Posts
    23
    Rep Power
    0

    Default frames

    guys if i want to have a lot of frames in my java program do i have to write all of them by my hand like this-
    Java Code:
    import javax.swing.JFrame;
    
    public class Main{
    	public static void main(String[] args) {
    		JFrame frame=new JFrame("giorgi");
    		frame.setSize(500,500);
    		frame.setVisible(true);
    		frame.setResizable(true);
    		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);	
    	}
    }
    or there is the shorter way to make them?

  2. #2
    giorgi is offline Member
    Join Date
    Apr 2011
    Posts
    23
    Rep Power
    0

    Default

    there are already made windows,textboxes,labels and others in C#.and where are they in java?

  3. #3
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,234
    Rep Power
    7

    Default

    You program should only have a single JFrame. Secondary windows should be JDialogs.

    There are a couple of predefined dialogs (JFileChooser, JColorChooser, JOptionPane).

    See: A Visual Guide to Swing Components (Java Look and Feel) (The Java™ Tutorials > Graphical User Interfaces > Swing Features)

Similar Threads

  1. setSize without frames
    By Javaer in forum New To Java
    Replies: 1
    Last Post: 01-09-2011, 02:41 AM
  2. travelling between frames
    By Stephen Douglas in forum New To Java
    Replies: 24
    Last Post: 07-04-2010, 03:51 PM
  3. jsp frames
    By vasug in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-16-2010, 05:00 PM
  4. Switching Frames
    By jonnytabpni in forum New To Java
    Replies: 1
    Last Post: 11-08-2009, 10:12 PM
  5. Help regarding Frames
    By ramesh.8189 in forum AWT / Swing
    Replies: 14
    Last Post: 02-15-2009, 08:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •