Results 1 to 4 of 4

Thread: Layouts ?

  1. #1
    plodos is offline Member
    Join Date
    Jul 2007
    Posts
    3
    Rep Power
    0

    Default Layouts ?

    i want to make that interface but i dont know what must i do ?
    ---Customer Information-------------------
    - name textbox -
    - surname textbox -
    - adres textbox -
    ------------------------------------------

    these are my codes, thats working but , interface is a little different :)
    i dont know how to make "Customer Information" panel...

    Java Code:
    import javax.swing.*;
    
    import java.awt.*;
    
    public class hamOrder extends JFrame {
    	
    	private JTextField name = new JTextField(13);
    	private JTextField adres = new JTextField(13);
    	
    	public hamOrder(){
    		JPanel p1 = new JPanel();
    		JPanel p2 = new JPanel();
    		JPanel p3 = new JPanel();
    		
    		p1.setLayout(new BorderLayout());
    		p2.setLayout(new FlowLayout());
    		p3.setLayout(new FlowLayout());
    		
    		p2.add(new JLabel("Enter your name and surname"),BorderLayout.WEST);
    		p2.add(name, BorderLayout.EAST);
    		p3.add(new JLabel("Enter your adress"),BorderLayout.WEST);
    		p3.add(adres,BorderLayout.EAST);
    		
    		p1.add(p2,BorderLayout.NORTH);
    		p1.add(p3, BorderLayout.SOUTH);
    		
    		setTitle("Hamburger Order");
    	    setContentPane(p1);
    	    
    	    pack();
    		}
    
    public static void main (String [] args) {
    	hamOrder win = new hamOrder();
    	win.setVisible(true);
    	
    }
    
    }
    Could u help me
    thnx for everything
    Last edited by levent; 07-29-2007 at 06:42 PM. Reason: Code is placed inside [code] tag!

  2. #2
    cruxblack is offline Senior Member
    Join Date
    Jul 2007
    Posts
    130
    Rep Power
    0

    Default

    Eh?:confused:
    Sorry, i don't get what u wanna do, u manage to create the Hamburger Order frame just fine, why can't u modify the code a lil just to change the interface then?:confused:
    Dunno if this' what u mean, but here's my code
    Java Code:
    //made by CruxBlack
    import java.awt.*;
    import javax.swing.*;
    
    public class CustomerInfoPanel
    {
    	private static JPanel createPanel(String labelName,int size)
    	{
    		JPanel panel = new JPanel();
    		JLabel label = new JLabel(labelName);
    		JTextField field = new JTextField(size);
    		panel.add(label);
    		panel.add(field);
    		return panel;
    	}
    	
    	public static void main(String[] args)
    	{
    		String frameName = "Customer Information";
    		JFrame frame = new JFrame(frameName);
    		
    		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		frame.setVisible(true);
    		frame.setLayout(new GridLayout(3,1));
    		
    		frame.add(createPanel("Name",20));
    		frame.add(createPanel("Surname",20));
    		frame.add(createPanel("Address",20));
    		
    		frame.pack();
    	}
    }

  3. #3
    cruxblack is offline Senior Member
    Join Date
    Jul 2007
    Posts
    130
    Rep Power
    0

    Default

    Oh n btw, just adding an advice, define the default close operation please, just realize when i looked at my cmd that ur program were still running and haven't closed completely even after i close the graphical interface

    Be careful next time ok

  4. #4
    plodos is offline Member
    Join Date
    Jul 2007
    Posts
    3
    Rep Power
    0

    Default

    thnx for your advice & fast reply :))))
    at the before , i didnt know how to use close operation :)))))))
    this is my project ImageShack - Hosting :: picinfoex6.jpg
    nowadays im trying to do that assignment, its difficult for me :)))

    and if you know that , pls inform me
    c#.net has a builder , thats very easy to make such a customerInfo project
    but the Java (eclipse) has not any builder option, i have to write all the code

    im still thinking about the which one is better ?
    when im looking for desktop project
    all windows programs wrote by .NET
    i didnt find any Java desktop project

    Where the programmers use Java Language, what kind of application ?

    * im sorry , i have some problem with English language *

Posting Permissions

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