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

    Default button formalize

    hello.i try to write a windows form,and add on it some buttons and labels.when i add them they are in the middle of the panel.what can i do if i want to set them in the left or if i want to increase its size?
    my code is here:
    Java Code:
    import javax.swing.*;
    
    public class Frame implements ActionListener {
    	JFrame frame = new JFrame("Person");
    	JPanel panel=new JPanel();
    	
    	JLabel label=new JLabel("registracia");
    	JButton but=new JButton("aa");
    	
    	public void formalize(){
    		frame.setSize(500,500);
    		frame.setVisible(true); 
    		frame.setResizable(false);
    		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		
    		frame.add(panel);
    		panel.add(label);
    		panel.add(but);
    		
    
    	}
    }

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

    Default

    don't be lazy.if anyone knows about this please write

  3. #3
    pugazhendhi's Avatar
    pugazhendhi is offline Pugazhendhi
    Join Date
    May 2011
    Location
    Bangalore
    Posts
    20
    Rep Power
    0

    Default

    hi .,, use some layout patterns always ., if u want ur application in form like manner ., u have to use gridbaglayout ., study about gridbaglayout ., if cant able to get ., how it works ., reply me .,


    dont use lazy like words in forum ., ur problem is not so intresting topic to discuss ., so no one ., will have interest to solve that one .,.

    if u cant able to get obout gridbaglayout ., post a reply ., i will edit u r code and post it again
    :) Small word can mean it more ,.

Similar Threads

  1. Make a button class that uses your button image.
    By eLancaster in forum New To Java
    Replies: 1
    Last Post: 04-26-2011, 11:32 AM
  2. Adding a sqrt button and percentage button to a calculator
    By Josie_Taylor in forum New To Java
    Replies: 4
    Last Post: 03-14-2011, 01:16 AM
  3. Tab button
    By Zack in forum Suggestions & Feedback
    Replies: 0
    Last Post: 07-28-2010, 08:40 AM
  4. SWT - X Button
    By dorgin in forum SWT / JFace
    Replies: 0
    Last Post: 06-16-2010, 04:05 PM
  5. Button
    By Tb0h in forum New To Java
    Replies: 6
    Last Post: 07-22-2009, 01:28 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
  •