This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

border layout

 
harsimran kochar
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1776
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your question?
HowToAskQuestionsOnJavaRanch
 
John Jai
Rancher
Posts: 1776
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic