谁能提供一个java小程序代码?
发布网友
发布时间:2022-04-24 03:15
我来回答
共5个回答
热心网友
时间:2023-10-24 06:34
这就是最简单的了,有窗体,还有事件监听,实现的功能很多的
package Test;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
public class AppletMouse extends JFrame implements CaretListener
{
JTextArea txt=new JTextArea();
AppletMouse()
{
super("JAVA计算文本字符函数测试");
this.setSize(200,200);
this.setLayout(null);
txt.setBounds(20,25,100,20);
txt.addCaretListener(this);
this.add(txt);
this.setVisible(true);
}
public static void main(String []args)
{
new AppletMouse();
}
public void caretUpdate(CaretEvent arg0)
{
this.setTitle("字节数:"+txt.getText().length());
}
}
热心网友
时间:2023-10-24 06:34
哈哈!最简单的!
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello world!");
}
}
热心网友
时间:2023-10-24 06:34
public class test
{ public static void main(String[] args)
{
System.out.println("hello!");
}
}
热心网友
时间:2023-10-24 06:35
public class a
{ public static void main(String[] args)
{int a=1,b=2;
int c=a+b;
System.out.println(c);
}
}
热心网友
时间:2023-10-24 06:36
public class test
{
public static void main(String[] args)
{
System.out.println("A");
}
}
热心网友
时间:2023-10-24 06:33
这就是最简单的了,有窗体,还有事件监听,实现的功能很多的
package Test;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
public class AppletMouse extends JFrame implements CaretListener
{
JTextArea txt=new JTextArea();
AppletMouse()
{
super("JAVA计算文本字符函数测试");
this.setSize(200,200);
this.setLayout(null);
txt.setBounds(20,25,100,20);
txt.addCaretListener(this);
this.add(txt);
this.setVisible(true);
}
public static void main(String []args)
{
new AppletMouse();
}
public void caretUpdate(CaretEvent arg0)
{
this.setTitle("字节数:"+txt.getText().length());
}
}
热心网友
时间:2023-10-24 06:33
这就是最简单的了,有窗体,还有事件监听,实现的功能很多的
package Test;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
public class AppletMouse extends JFrame implements CaretListener
{
JTextArea txt=new JTextArea();
AppletMouse()
{
super("JAVA计算文本字符函数测试");
this.setSize(200,200);
this.setLayout(null);
txt.setBounds(20,25,100,20);
txt.addCaretListener(this);
this.add(txt);
this.setVisible(true);
}
public static void main(String []args)
{
new AppletMouse();
}
public void caretUpdate(CaretEvent arg0)
{
this.setTitle("字节数:"+txt.getText().length());
}
}
热心网友
时间:2023-10-24 06:34
哈哈!最简单的!
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello world!");
}
}
热心网友
时间:2023-10-24 06:34
这就是最简单的了,有窗体,还有事件监听,实现的功能很多的
package Test;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
public class AppletMouse extends JFrame implements CaretListener
{
JTextArea txt=new JTextArea();
AppletMouse()
{
super("JAVA计算文本字符函数测试");
this.setSize(200,200);
this.setLayout(null);
txt.setBounds(20,25,100,20);
txt.addCaretListener(this);
this.add(txt);
this.setVisible(true);
}
public static void main(String []args)
{
new AppletMouse();
}
public void caretUpdate(CaretEvent arg0)
{
this.setTitle("字节数:"+txt.getText().length());
}
}
热心网友
时间:2023-10-24 06:34
哈哈!最简单的!
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello world!");
}
}
热心网友
时间:2023-10-24 06:34
public class test
{ public static void main(String[] args)
{
System.out.println("hello!");
}
}
热心网友
时间:2023-10-24 06:35
public class a
{ public static void main(String[] args)
{int a=1,b=2;
int c=a+b;
System.out.println(c);
}
}
热心网友
时间:2023-10-24 06:36
public class test
{
public static void main(String[] args)
{
System.out.println("A");
}
}
热心网友
时间:2023-10-24 06:34
哈哈!最简单的!
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello world!");
}
}
热心网友
时间:2023-10-24 06:34
public class test
{ public static void main(String[] args)
{
System.out.println("hello!");
}
}
热心网友
时间:2023-10-24 06:34
public class test
{ public static void main(String[] args)
{
System.out.println("hello!");
}
}
热心网友
时间:2023-10-24 06:35
public class a
{ public static void main(String[] args)
{int a=1,b=2;
int c=a+b;
System.out.println(c);
}
}
热心网友
时间:2023-10-24 06:36
public class test
{
public static void main(String[] args)
{
System.out.println("A");
}
}
热心网友
时间:2023-10-24 06:35
public class a
{ public static void main(String[] args)
{int a=1,b=2;
int c=a+b;
System.out.println(c);
}
}
热心网友
时间:2023-10-24 06:36
public class test
{
public static void main(String[] args)
{
System.out.println("A");
}
}