❶ 用java怎麼寫QQ
用java是可以寫出qq的,只不過用java開發c/s的軟體不是java特長的,你要是真的想寫,就寫著練練手吧,最起碼可以鞏固java se上的知識。
具體怎麼寫,給你個大概的思路吧,因為我沒辦法在這個有限的輸入框內把所有的代碼寫完。
【1】先寫出qq的簡單界面
【2】給每個按鈕添加監聽
【3】按鈕事件(方法)定義
【4】連接網路(socket)
【5】測試
【5】其他功能添加
【6】測試
❷ 怎麼用java打開qq
java實現簡單QQ登陸界面:
1.生成界面的java代碼
packageQQ2014;
importjavax.swing.*;
importjava.awt.*;
importjava.awt.event.*;
publicclassQQ2014{
//創建登陸界面類
publicvoidshowLoginFrame(){
//創建船體對象
JFrameloginFrame=newJFrame();
//設置大小,位置,標題
loginFrame.setSize(300,200);
loginFrame.setTitle("QQ2014");
loginFrame.setLocationRelativeTo(null);
//創建流式分布對象
FlowLayoutlayout=newFlowLayout();
loginFrame.setLayout(layout);
//創建賬戶名,密碼和輸入框
JLabeluser_name=newJLabel("賬號:");
JLabeluser_password=newJLabel("密碼:");
JTextFieldfield_name=newJTextField(20);
JPasswordFieldfield_password=newJPasswordField(20);
//創建登陸,重置按鈕
JButtonbutton_reset=newJButton("重置");
JButtonbutton_login=newJButton("登陸");
//設置窗體可見
loginFrame.setVisible(true);
//創建事件監聽對象
ActionListeneraction_listener1=newActionListener(){
publicvoidactionPerformed(ActionEvente){
Stringname=field_name.getText();
Stringpassword=field_password.getText();
if("zhaoxin".equals(name)&&"123".equals(password))
{
showIndexFrame();
loginFrame.setDefaultCloseOperation(3);
loginFrame.setVisible(false);
}
else{
System.out.println("密碼錯誤,重新輸入!");
}
}
};
ActionListeneraction_listener2=newActionListener(){
publicvoidactionPerformed(ActionEvente){
field_name.setText("");
field_password.setText("");
}
};
//將文本輸入框,按鈕,事件監聽對象添加
loginFrame.add(user_name);
loginFrame.add(field_name);
loginFrame.add(user_password);
loginFrame.add(field_password);
loginFrame.add(button_reset);
loginFrame.add(button_login);
button_reset.addActionListener(action_listener2);
button_login.addActionListener(action_listener1);
}
publicvoidshowIndexFrame(){
//創建窗體對象
JFrameindexFrame=newJFrame();
indexFrame.setSize(200,500);
indexFrame.setTitle("QQ好友列表");
indexFrame.setLocationRelativeTo(null);
//設置流式分布對象
FlowLayoutlayout=newFlowLayout(FlowLayout.CENTER,100,10);
indexFrame.setLayout(layout);
//創建好友按鈕
for(inti=0;i<10;i++)
{
JButtonbutton_friend=newJButton("friend"+i);
//創建動作事件監聽對象
ActionListeneraction_listener=newActionListener()
{
publicvoidactionPerformed(ActionEvente)
{
showChatFrame();
indexFrame.setVisible(false);
indexFrame.setDefaultCloseOperation(3);
}
};
button_friend.addActionListener(action_listener);
indexFrame.add(button_friend);
}
//設置窗體可見
indexFrame.setVisible(true);
}
publicvoidshowChatFrame(){
//創建窗體,大小,位置,標題
JFramechatFrame=newJFrame();
chatFrame.setSize(400,400);
chatFrame.setTitle("正在聊天中...");
chatFrame.setLocationRelativeTo(null);
//創建聊天記錄,輸入域
JTextAreaarea_input=newJTextArea(10,30);
JTextAreaarea_record=newJTextArea(5,30);
//創建流式分布對象
FlowLayoutlayout=newFlowLayout(FlowLayout.CENTER,0,10);
chatFrame.setLayout(layout);
//創建發送,關閉按扭
JButtonbutton_send=newJButton("發送");
JButtonbutton_close=newJButton("關閉");
//創建動作事件監聽對象
ActionListeneraction_listener1=newActionListener()
{
publicvoidactionPerformed(ActionEvente){
area_record.setText(area_record.getText()+"
"+area_input.getText());
area_input.setText("");
}
};
ActionListeneraction_listener2=newActionListener()
{
publicvoidactionPerformed(ActionEvente){
chatFrame.setVisible(false);
chatFrame.setDefaultCloseOperation(3);
}
};
//設置窗體可見
chatFrame.setVisible(true);
//添加按鈕,事件監聽對象
chatFrame.add(area_record);
chatFrame.add(area_input);
chatFrame.add(button_send);
chatFrame.add(button_close);
button_send.addActionListener(action_listener1);
button_close.addActionListener(action_listener2);
}
}
復制代碼
2.javamain方法調用
packageQQ2014;
publicclassTest{
publicstaticvoidmain(String[]args){
QQ2014qq=newQQ2014();
qq.showLoginFrame();
}
}
❸ JAVAQQ怎麼安裝
下載好了會提示安裝的 找到java軟體按確定也會安裝 如果你手機java內存小的話建議不要用 java手機一般都有MTK平台 java運行大一點的軟體老是黑屏運行還慢的要死 也只是適合玩些小的游戲 用MTK平台吧
❹ java做QQ
主要我想是用到兩大塊一個用到java.swing裡面的類,一塊是java.net的類,伺服器端應該要有資料庫存儲用戶信息,對java做桌面軟體了解不多不多說了,我記得看大電驢上有做山寨QQ的教程,樓主可以去下來看看學習一下
❺ 手機javaqq軟體下載
在手機騰訊網上找通用版下,不過如果機子跑得動的話強烈建議找07版以上的,可以下諾基亞索愛的相同屏幕的試試。
❻ JAVA版QQ今天還能用嗎
目前來看的話JAVA版的QQ還是可以用的,不過你需要用那種比較老式的塞班系統手機才能下載安裝使用。
❼ JAVA 的QQ版本是什麼
2011
❽ Java簡易qq聊天,代碼
這種東西,除非是網路上原本就有的。否則你幾乎要不到的,即使是簡易版想做出來,除非是高手,起碼要一個星期。
❾ JavaQQ觸屏
你可以去手機騰訊網里,到QQ下載里,找到聯想的i60型號,下載安裝就可以了。要不你用QQ網網頁上QQ,也可以,不要裝QQ.
❿ javaqq登陸是什麼意思
第三方登錄,就是你的系統可以用qq登錄,技術上屬於單點登錄