连HelloWorld 都不会写?????
public class HelloWorld
{
public static void main(String []args)
{
System.out.println("HelloWorld");
}
}
在文件目录的命令行下输入javac HelloWorld.java 再输入java HelloWorld
楼主去看下顶置贴吧!~
那里说得很详细
java菜鸟级交流群34523061,热心助人高手欢迎加入
import java.awt.*;
import javax.swing.*;
public class MyFlowLayout extends JFrame
{
JPanel panel;
JPanel panel1,panel2;
JButton b1,b2,b3,b4;
public MyFlowLayout()
{
panel=new JPanel();
panel.setLayout(new GridLayout(1,2));
this.getContentPane().add(panel);
panel1=new JPanel();
panel1.setLayout(new FlowLayout(FlowLayout.LEFT));
panel.add(panel1);
panel2=new JPanel();
panel2.setLayout(new FlowLayout(FlowLayout.RIGHT));
panel.add(panel2);
b1=new JButton("button1");
b2=new JButton("button2");
b3=new JButton("button3");
b4=new JButton("button4");
panel1.add(b1);
panel1.add(b2);
panel2.add(b3);
panel2.add(b4);
this.setSize(400,400);
this.setVisible(true);
}
public static void main(String args[])
{
new MyFlowLayout();
}
}
没有错 你拿去看看可以不