⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 6-5-1

📁 java入门的几个代码,很实用,初学者不可错过
💻
字号:
package CopyFile;
import java.awt.*;
import java.awt.event.*;
import borland.jbcl.layout.*;
import borland.jblcl.control.*;
public class MainFrame extends Frame { 
TextField textFieldl= new TextField();
Button button1 =new Button();
Label labe11 =new Label();
Label labe12 =new Label();
TextField textField2 =new TextField();
Button button2= new Button();
Button button3= new Button();
Button button4= new Button();
Label labe13 =new Label();
Panel Pane11 =new Panel(); 
PaneLayout paneLayout1=new PaneLayout();
PaneLayout paneLayout2=new PaneLayout();
GroupBox groupBox1=new PaneLayout();
List list1 =new List();
PaneLayout paneLayout3=new PaneLayout();
public MainFrame()  {
try{
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
} 
private void jbInit() throws Exception { 
this.setSize(new Dimension(454,154));
this.setTitle(″拷贝文件″);
this.setBackground(new Color(192,192,192);
button.setLabel(″浏览″…);
button1.addActionListener(new MainFrane_button1_actionAdapter(this)); .
//按钮的监听器接口类MainFrane_button1_actionAdapter由Jbuild生成
labell.setAlignment(2);
labell.setText(″源文件:″);
labell.setAlignment(2);
labell2.setText(″目的文件″);
button2.setLabel(″复制″); 
button2.addActionListener(new MainFrame_button2_actionAdapter(this)); 
//按钮的监听器接口类MainFrane_button2_actionAdapter由Jbuild生成 
button3.setLabel(″退出″);
button4.addAactionListener(new MainFrame_button4_actionAdapter(this));
//按钮的监听器接口类MainFrane_button4_actionAdapter由Jbuild生成 
button3.addAactionListener(new MainFrame_button3_actionAdapter(this)); 
//按钮的监听器接口类MainFrane_button3_actionAdapter由Jbuild生成 
this.setLayout(paneLayout1);
this.add(panel.new PaneConstraints
(″panell″, ″panell″,PaneConstraints.ROOT,0,5f); 
panel1.add(groupBox1,new PanConstraints 
(″groupBox1″,″groupBox1″,PaneConstraints.ROOT,1.of)); 
groupBox1.add(list1. new  PaneConstraints
(″listl″, ″listl″,PaneConstraints.ROOT, I.of)); 
this.add(labell,new  PanConstraints 
(“lable3”, “panell”,PaneConstraints.LEET,0.6300448f); 
this.add(labell.?new?PaneConstraints(“labell,“labell3”,
PaneConstraints,BOTTOM,0.68589747f) 
this.add(label2,new PaneConstraints(“label2”, “labell”,PaneConstraints,BOTTOM,0.6730769f));
this.add(textField,newPaneConstraints(“textField”,“labell”,PaneConstraints,RIGHT,0.76868325f));
this.add(button1,newPaneConstraints(“textField”,“labell”,PaneConstraints,RIGHT,0.76868325f)); 
this.add(button4,newPaneConstraints(“textField2”,“label2”,PaneConstraints.RIGHT,0.7686325f)); 
this.add(button4,new PaneConstraints
(“button4”,“textField2”,PaneConstraints.RIGHT,0.3442623f)); 
this.add(button3.new PaneConstrains 
(“button3”, “button2”,PaneConstraints.RIGHT,0.4798851f)); 
} 
public static  void main(String[] args)  { 
Main Frame frame=new MainFrame();
frame.setLocation(200,200);
frame.setSize(450,150);
frame.show();  
}
void buttonl_actionPewrformed(ActionEvent e) {
} 
void button2_actionPerformed(ActionEvent e) 
{
}
void button3_actionPerformed(ActionEvent e) 
{
}
void button4_actionPerformed(ActionEvent e) 
{
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -