jscrollpane

import java.awt.FlowLayout;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;


public class Test001 extends JFrame implements ActionListener {
private   GridBagLayout layout;
private   JTextField aa;
private   JButton bb;
private JTextArea jtextarea;
JScrollPane jscrollpane;
public Test001(){
     aa=new JTextField(10);
     bb=new JButton("执行");
     bb.addActionListener(this);
     jtextarea=new JTextArea("sdfsadfasdfasdsssssssssssssssssssssssssssssss");
     jscrollpane=new   JScrollPane();
     jscrollpane.setBounds(50, 20, 380, 350);
     jscrollpane.getViewport().add(jtextarea);
     aa.setBounds(150,380,200,20);
     bb.setBounds(200, 420, 100, 20);
     getContentPane().add(aa);
     getContentPane().add(bb);
     getContentPane().add(jscrollpane);
     getContentPane().setLayout(layout);
     setSize(500,500);//大小
     setLocation(300,200);//定位
     setVisible(true);
     setTitle("欢迎使用JAVA");
}

  

     
/**
*
*/

@Override
public void actionPerformed(ActionEvent arg0) {
   // TODO Auto-generated method stub

}

/**
* @param args
*/
public static void main(String[] args) {
   // TODO Auto-generated method stub
          Test001 a= new Test001();
        
}

}

Views: 169 Comments: 5 Favorited: 0

Comments

Sign Up and login in order to leave a comment.
LaserHairRemoval
Comment by LaserHairRemoval Aug. 01,2008
+1
Omer89
Comment by Omer89 Jul. 28,2008
+
veera
Comment by veera Jul. 18,2008
+
arrozada
Comment by arrozada Jul. 07,2008
+
joydozy
Comment by joydozy Jul. 06,2008
+1
Added May 20, 2008
prettyaini


to prettyaini

Recent Posts
Syndication Tools
  • Subscribe to Flixya Blog Feed
  • Ping your RSS Feed
  • Add to Technorati Favorites!