my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes GridBagLayout Manager ? How i create screen with the help of gridbaglayout? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

GridBagLayout Manager ? How i create screen with the help of gridbaglayout?

Parveen thakur
Greenhorn

Joined: Oct 12, 2011
Posts: 19
HI aLL,:
Can anyone help me please ?how i can use the GridbagLaout and GridBagConstraints in the following code .Can any one create the code for the following screen with this manager for same look and feel ?



code here......


[edit - added code tags - MB]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> Can any one create the code for the following screen with this manager for same look and feel ?

doesn't look too hard.

if you want someone to do it for you, try rent-a-coder
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Because we are NotACodeMill.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Parveen thakur
Greenhorn

Joined: Oct 12, 2011
Posts: 19
Thanks Both of you but any one tell me how to use gridbaglayout insted of setbounds...

this.getContentPane().setBackground(Color.WHITE);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setLayout(null);
getLogoLabel().setIcon(new ImageIcon(getClass().getResource("/Images/Vm_img.png")));
getLogoLabel().setBounds(5,0,220,50);
this.add(getLogoLabel());
getVbmlogoLabel().setIcon(new ImageIcon(getClass().getResource("/Images/vmlogo2.png")));
getVbmlogoLabel().setBounds(350,180,250,200);
this.add(getVbmlogoLabel());
getReleaseVersionLable().setBounds(800,10,200,25);
getReleaseVersionLable().setFont(new Font("Courier New", Font.ITALIC, 11));
this.add(getReleaseVersionLable());
getReleaseVersionDataLable().setBounds(970,10,200,25);
getReleaseVersionDataLable().setFont(new Font("Courier New", Font.ITALIC, 11));
this.add(getReleaseVersionDataLable());
getPowerByLable().setBounds(30,600,300,25);
getPowerByLable().setForeground(c);
getPowerByLable().setFont(new Font("Courier New", Font.ITALIC, 11));
this.add(getPowerByLable());
this.setBackground(Color.BLACK);
this.setTitle("VBM Data Review - Login");
this.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/Images/icon.png")));
/* myParams.getLabelHead().setBounds(500,30,300,25);
this.add(myParams.getLabelHead());*/
getPanel().setBounds(650,150,400,300);
getPanel().setBorder(BorderFactory.createLineBorder(null));
getPanel().setLayout(null);
getPanel().setBackground(Color.WHITE);
getUserNameLabel().setBounds(30,100,150,25);
getPanel().add(getUserNameLabel());
getUserTextField().setBounds(150, 100, 150, 25);
getPanel().add(getUserTextField());
getPasswordLabel().setBounds(30, 150, 150, 25);
getPanel().add(getPasswordLabel());
getPasswordTextField().setBounds(150, 150, 150, 25);
getPanel().add(getPasswordTextField());
Color c= Color.decode("#6495ED");
getSubmitButton().setBounds(150,220,150,25);

getSubmitButton().setBackground(c);
getSubmitButton().setForeground(Color.WHITE);
getPanel().add(getSubmitButton());
getMassegelabel().setBounds(15,255,400,15);
getMassegelabel().setFont(new Font("Curier New", Font.ITALIC, 11));
getPanel().add(getMassegelabel());
/*getResetButton().setBounds(620,300,100,25);
this.add(getResetButton());
getExitButton().setBounds(740,300,100,25);
this.add( getExitButton());*/
this.add(getPanel());
this.getRootPane().setDefaultButton(getSubmitButton());
this.getSubmitButton().addNotify();
//this.setSize(1000,500);
this.setResizable(false);
this.setSize(screensize.width,screensize.height);
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10171
    
    8

Please do not post, essentially the same question multiple times. UseOneThreadPerQuestion
Let us continue the discussion in your original topic here http://www.coderanch.com/t/555746/GUI/java/create-screen-comaptible-all-resoluions


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GridBagLayout Manager ? How i create screen with the help of gridbaglayout?
 
Similar Threads
Problem with JSplitPane and JFrame
where is the frame and its components
TicTacToe - Computer's move
How to open a file using Java
create screen comaptible for all resoluions?