小程序教程

200分求一個小程序

字号+ 作者:H5之家 来源:H5之家 2017-07-19 11:02 我要评论( )

[200分求一個小程序]: 200分求一個小程序我有一個人主頁﹐我想有一個JAVAAPPLET和源程序﹐功能是﹕JAVAAPPLET有一個文本框﹐和一個按鈕﹐按下按鈕後﹐JAVAAPPLET

200分求一個小程序
我有一個人主頁﹐我想有一個JAVAAPPLET和源程序﹐功能是﹕
JAVAAPPLET有一個文本框﹐和一個按鈕﹐按下按鈕後﹐JAVAAPPLET
就把文本框中的內容添加到在我的主頁空間中的一個文件中。
假設我的主頁地址為X.best.163.com﹐我的FTP用戶名為U,FTP密碼為P。
請大家幫幫我。還有100分可以再發次貼給。


|

这个是读签名后读本地文件的applet,
importjava.awt.*;
importjava.awt.event.*;
importjava.applet.*;
importjava.io.*;

publicclassFileReaderAppletextendsApplet{
booleanisStandalone=false;
TextFieldfileNameField;
TextAreafileArea;

file://Getaparametervalue
publicStringgetParameter(Stringkey,Stringdef){
 returnisStandalone?System.getProperty(key,def):
 (getParameter(key)!=null?getParameter(key):def);
}

file://Constructtheapplet
publicFileReaderApplet(){
}

file://Initializetheapplet
publicvoidinit(){
try{
jbInit();
}
catch(Exceptione){
e.printStackTrace();
}
}

file://Componentinitialization
privatevoidjbInit()throwsException{
this.setSize(newDimension(400,300));
this.setLayout(newBorderLayout());
Panelpanel=newPanel();
Labellabel=newLabel("FileName");
panel.add(label);
fileNameField=newTextField(25);
panel.add(fileNameField);
Buttonb=newButton("OpenFile");
b.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
loadFile(fileNameField.getText());
}
});
panel.add(b);
this.add(panel,BorderLayout.NORTH);
fileArea=newTextArea();
this.add(fileArea,BorderLayout.CENTER);
}

publicvoidloadFile(StringfileName){
try{
BufferedReaderreader=newBufferedReader(newFileReader(fileName));
Stringcontext=newString();
while((context=reader.readLine())!=null){
fileArea.append(context+"/n");
}
reader.close();
}catch(IOExceptionie){
fileArea.append(ie.getMessage());
}catch(SecurityExceptionse){
fileArea.append("becauseofsecurityconstraint,itcannotdothat!");
}
}

file://GetAppletinformation
publicStringgetAppletInfo(){
return"Thisisanappletcanreadandwritethelocalfilesystem";
}

}


|

我发了一个到你邮箱,希望对你有用!!

 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
网友点评