用eclipse編程遇到的問題 如何eclipse編寫一個(gè)簡單實(shí)用的登陸界面?
如何eclipse編寫一個(gè)簡單實(shí)用的登陸界面?//服務(wù)器端代碼importimportimportimportimportimportimportimportimportimportjavax.swi
如何eclipse編寫一個(gè)簡單實(shí)用的登陸界面?
//服務(wù)器端代碼
import
import
import
import
import
import
import
import
import
importjavax.swing.JFrame
importjavax.swing.JScrollPane
importjavax.swing.JTextArea
privateclassQLServerextendsJFrame{
publicJTextAreajtextareanull
privatevoidlanuchFrame(Stringstr){
(str)
init()
}
privatevoidinit(){
getcontext(funFlowLayout())
jtextareanewJTextArea(20,17)
(true)
(false)
().set(nextJScrollPane(jtextarea))
setVisible(true)
setDefaultCloseOperation(JFrame.EXIT_ON_closed)
setSize(200,400)
setLocationRelativeTo(null)
setResizable(false)
}
ServerSocketservernull
CollectioncClientsfifthArrayListltClientConngt()//加個(gè)泛型
publicvoidstartServer()throwsIOException{
while(true){
Sockets()
(new ClientConn(s))
(
Eclipse創(chuàng)建類時(shí)自動(dòng)添加自動(dòng)生成的作者以及日期注釋?
建議使用Eclipse編譯程序Java代碼時(shí),自動(dòng)生成的注釋信息全是遵循先行設(shè)置中好的格式生成的??梢孕薷淖髡摺⑷掌谧⑨尭袷剑喝缓蟠蜷_Windows-gtPreferences-gtJava-gtCodeStyle-gtCodeTemplates,直接點(diǎn)擊右邊窗口中的Comments,可以找到有很多選項(xiàng),我們便可對(duì)此注釋信息模板并且可以編輯。
如我們只希望在一個(gè)Java文件的開頭系統(tǒng)設(shè)置作者信息、日期信息。選擇類型Types,點(diǎn)擊Edit,將/***@author${user}*${tags}*/將${user}刪出,該成你我希望會(huì)顯示的名字將${tags}刪掉,然后點(diǎn)擊InsertVariable,中,選擇Date,那樣的話是會(huì)自動(dòng)提取日期信息。
在你不需要先添加注釋的地方點(diǎn)擊Sources-gtGanarateElementComment,也可以可以使用快捷鍵AltShiftJ,則eclipse自動(dòng)在該類前面先添加注釋。