wood burning stoves 2.0*
The moose likes Java in General and the fly likes border layout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "border layout" Watch "border layout" New topic
Author

border layout

harsimran kochar
Greenhorn

Joined: Sep 09, 2011
Posts: 14
import java.awt.*;
import javax.swing.*;
import java.awt.BorderLayout;


class Welcum extends JFrame {
Container c;
JButton bFd,bAcct;
JLabel lWelcome;

public Welcum() {
c=getContentPane();
setTitle("welcome");
setBounds(0,0,800,500);
//setLayout(BorderLayout);
bFd=new JButton("fdDetails");
c.add(BorderLayout.NORTH,bFd);

lWelcome=new JLabel("welcome");
lWelcome.setFont(new Font(Font.DIALOG,Font.BOLD,68));
c.add(BorderLayout.CENTER,lWelcome);

bAcct=new JButton("AccountDetails");
c.add(BorderLayout.SOUTH,bAcct);

setVisible(true);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);

}
public class welcome{

public static void main(String[] args){
//new FrmAdd();
new Welcum();
}
}

}
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
What is your question?
HowToAskQuestionsOnJavaRanch
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
The public class welcome is coded as a inner class of Welcum. Might be mistakenly the closing "}" of the Welcum class is placed at the last. Remove the last "}" and add it just before the welcome class...
 
 
subject: border layout
 
Similar Threads
Getting "Type expected" when trying to compile applet
Problem with String Tokenizer
new window within a program...
moving labels
in creating project file from existing main files