求一个怎样成为编程高手手..我游戏数据被复制了..求个解决办法

天极传媒:天极网全国分站
您现在的位置:
& &&VBA编程简化Excel操作的两个实例
VBA编程简化Excel操作的两个实例
天极软件 10:37
未经网许可,请勿擅自转载此原创文章
  说起用VBA编程,很多人都认为是很困难的事情,是编程们的游戏。当然,这样的说法也不无道理,因为VBA编程需要有面向对象程序设计的基础,要求编程的人要懂得对象、事件、属性的概念和熟悉VB程序设计的表达方式,这些都会使人望而生畏。
  Excel的“录制宏”功能,是VBA编辑应用的良好载体。结合在DOS里学过的一点点BASIC语言基础,就能编写VBA程序,解决我们工作中的一些具体问题。
  例1、制作简易工资条
  工资条打印是实现在工资表中每个员工工资数据前加一行表头,工资数据后加一个空行,其步骤如下:
  1、录制新宏。
  在Excel工资表中,选择菜单上的“工具”、“宏”、“录制新宏”命令,在弹出的“录制新宏”对话框中“宏名(M)”处填上“工资条”、“保存在( I )”处选择“当前工作簿”后,点“确定”见图1。
  2、插入表头和空行
  右击工资表的第一行,即表头,选快捷菜单的“复制”命令,再右击工资表的第三行,选快捷菜单的“插入复制单元格”命令,在第二个人的工资数据前插入表头;再右击第三行,选快捷菜单的“插入”命令,插入一个空行。
  3、停止录制
  点菜单的“工具”、“宏”、“停止录制”命令,停止宏的寻制。
  4、查看录制的宏程序
  点菜单的“工具”、“宏”、“宏”命令或直接用快捷键“Alt + F8”打开“宏”对话框,在“宏名”处选择“工资条”,点“编辑”打开录制的宏程序代码见图2。
  5、在录制的宏程序中添加循环语句
  假如工资表中有200人。只需添加一个循环语句:
  For I=1 To 200  Next
  并将Rows("3:3").Select 这条固定的语句,更改为随循环变量I变化的语句:
  Rows( I * 3 ).Select就行了,见图3。
  现在再来执行 “工资条”这个宏,200人的工资条在瞬间就制作出来了,很有成就感吧,不觉得编程也是很有趣的事吗?
  例2、取消单元格中的超级链接
  有时把网页上的表格复制到电子表格中后,网页中的超级链接也复制过来了,如图4中的列,稍不注意,一点上,就会打开相应的链接,很烦人,要取消这些单元格中的超链接,一个一个的取消很麻烦,我们就请VBA来帮忙。
  1、录制新宏
  同例1,宏名为“取消超链接”
  2、取消一个单元格中的超链接
  在图4所示的工作表中右击A2单元格,选快捷菜单中的“超级链接”、“取消超级链接”命令。
  3、停止录制
  同例1。
  4、查看录制的宏程序
  同例1,如图5。
  5、在录制的宏程序中添加循环语句
  ①用Do While …Loop语句检测数据表的列数
  i = 1  Do While Cells(1, i) && ""    ’ 检测表格的列数   i = i + 1    ’ i 为表格的列数   Loop
  ②用Do While …Loop语句检测数据表的行数
  j = 1  Do While Cells(j, 1) && ""   ’ 检测表格的行数   j = j + 1   ’j 为表格的行数   Loop
  ③添加双重循环for … next 语句遍历所有单元格。
  ④修改选择语句 Range(“A2”).Select 为 Cells(m, n).Select 让其随循环变量变化。见图6
  执行 “取消超链接”这个宏,表格中所有单元格的超链接都被取消了。当然,要取消表格中的超链接,也可以通过另存为文本的方式来实现,但通过这个例子,我们掌握了检测数据表中的行、列数的一个方法。
  通过以上两例,我们体会到:
  ①通过“录制新宏”功能得到核心语句;
  ②运用BASIC语言的循环语句实现自动处理;
  ③对其中的选择语句稍加改变,使之随循环变量变化。就能解决许多电子表格中的操作问题,
  只要经常对录制宏得到的核心语句进行分析,遇到其中不理解的语句就借助Office的帮助来学习,相信你的编程能力会有很大的长进。
  以上代码在Office2000、Office2002中通过。
  附:两个例子的源程序     1、工资条打印源程序:
  Sub 工资条()  ’  ’ 工资条打印宏 Macro  ’ 记录的宏   ’    ’   k = 2   For i = 1 To 54   j = i + k   Rows("").Select   Selection.Copy    Rows(j).Select    Selection.Insert Shift:=xlDown    k = k + 1    Next      End Sub
  2、取消超链接源程序:
   Sub Delete_Hyperlinks() ’ 取消链接的宏   i = 1   Do While Cells(1, i) && "" ’ 检测表格的列数   i = i + 1    Loop    j = 1    Do While Cells(j, 1) && "" ’ 检测表格的行数    j = j + 1    Loop    For m = 1 To j - 1    For n = 1 To i - 1    Cells(m, n).Select    Selection.Hyperlinks.Delete   Next n    Next m    End Sub
&&阅读关于
的全部文章
(作者:巫德贵 原创责任编辑:still)
天极新媒体&最酷科技资讯扫码赢大奖
* 网友发言均非本站立场,本站不在评论栏推荐任何网店、经销商,谨防上当受骗!
Win10系统在Win8的基础上对界面、特性以及跨平台方面做了诸多优化。
手机整机DIY企业级藤本植物导航
&>&&>&&>&正文
现在情况是这样的,老师让我们编写一个客户机/服务器程序,实现服务器和客...我这里有jdk1.6你下下去安装试试
紧急求助,一个简单的java编程问题,请高手帮帮忙!
jt1.awt,20),440;);
c.setBounds(200;
JTextArea jt1=new JTextArea(20;
f.awt.setBounds(0;,500.setBounds(0,20);
jl.add(b2),415,440;
JLabel jl=new JLabel(&public class yxClient2 {
public yxClient2() {
JFrame f=new JFrame(&quot.add(b1).setEditable(false);
Container c=f;
jt2.swing,60;
public static void main(String args[])
new yxClient2().add(jt2).setBounds(410.*;&
f,440.setBounds(0.add(jl);
JButton b2=new JButton(&清空&quot.*;请输入聊天内容;).exit(0),500.setVisible(true),200,50),300.event,20);).addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e)
S聊天室& 文本不可编辑
JTextField jt2=new JTextField(&quot,0,400);
JButton b1=new JButton(&quot.setLayout(null);
}).setBounds(320,20).setResizable(false):&
jt1;&#47.getContentPane(),500);),200;
f.*.add(jt1),60;发送&quotimport java
println(&/
} else {清除用户列表
} else if (source == sendMsgButton) {
/用于放置聊天信息显示和聊天人员列表
JPanel panel2 = new JPanel();&#47.util.
/定义一个字符缓冲存储发送信息
StringBuffer info = new StringBuffer(Constants.equals(C } /
ChatServer.getLocalHost();客户端连接信息&import java.JF**
* 退出菜单项事件
* @param e
*&#47.println(&#47.println(&quot.ActionE
dispose();用户列表&/&#47.getInputStream())).BorderFactory.QUIT_IDENTIFER))!/
/ public static synchronized void disconnect(ClientPpanel1放置输入姓名和连接两个按钮
JPanel panel1 = new JPanel().QUIT_IDENTIFER)), &&#47.append(
sendMsgB/将连接数减1
String constr = &
menuBar.swing.V&#47.elementAt(i).setText(constr).&#47, BorderLINFO&
parent.append(Constants.awt.List peopleList =
SError.addActionListener(this).BufferedRMSG&quot.BorderL&#47.exit(0);/ 0) {
ClientProcessor c = (ClientProcessor) clientP 连接服务器信息的标识符 public static final String CONNECT_IDENTIFER = &quot.println(&quot.statusBar.println(C&#47.
} } // + e);
this:&quot.关闭套接字
listener.println(& 消息输入框 JTextField msgTextField = new JTextField(20).setText(&连 接&quot.socket.nextToken();
/;E向客户发送断开连接信息
ChatS*以下定义数据流和网络变量*/
} catch (IOException e) {
System.out.JScrollPimport java.io, new Color(134,在服务器端将用一个
&#47.hashCode();
ServerSocket server = null.setBorder(new TitledBorder(BorderFactory.swing.&#47.firstElement(), C), 切断此次连接
S存储客户端的ip信息 String clientIP!= null) {
//0& 初始化图形界面 public void init() {&#47.append(Cimport javax.event.ServerS
&#47.&#47.println(msg.send(msg);断 开&
} } &#47, C读取客户端发来的数据流
line = protected void processWindowEvent(WindowEvent e) {如果关键字是QUIT则是服务器关闭的信息;
/定义并实例化一个字符缓冲存储发送的聊天信息
StringBuffer msg = new StringBuffer(C
&#47, 134、IP信息
String clientInfo = br.add(sendMsgButton);
exitMenuItem.UIM&#47.notifyRoomPeople().println(&
exitMenuItem.JLabel.swing.getContentPane();连接&&#47.
this.SERVER_PORT);
parent.&#47.&
/class ClientProcessor extends Thread { &#47.&#47.exit(0);
statusBar.
/ 将组件进行布局
JPanel jPanel1 = new JPanel().chatContentTextA
// } / / protected void processWindowEvent(WindowEvent e){ public static void notifyRoomPeople(){
StringBuffer people = new StringBuffer(C
System.hasMoreTokens())
String str = st.add(msglabel); 覆盖Object类的hashCode方法 public int hashCode(){
return (; 聊天室用户列表 如果点击断开连接按钮
disconnect().getSystemLookAndFeelClassName());0&
parent.nextToken(&/ + e). /
&#47.swing.WINDOW_CLOSING) {
/** * 聊天室的服务器端程序;
disconnect(c.SEPERATOR
+ InetA/&#47.addActionListener(this).equals(C不允许重复登陆&).println(msg).TitledB存储当前运行的ChatClient实例
ChatClient parent = null.contains(newclient)){
return false.white,根据要求决定是否从连接列表中删除
* @param client
* @param toRemoveFromList
ps = new PrintStream(s;&#47.MSG_IDENTIFER).readLine().println(&/ / }
&#47,GUI界面 */ JLabel msglabel = new JLabel();
&#47.createEtchedBorder(
Color.util.
this.sleep(200).setLayout(new FlowLayout());&#47.JP i &
System.getContentPane().setTitle(&/
&#47.soc = null.activeC&#47.size() &如果是PEOPLE则是服务器发来的客户连接信息
/聊天内容&quot.FlowL }} &#47.StringT
} catch (Exception e) {
e.event.hasMoreTokens()){
/ 服务器的端口号 public static final int SERVER_PORT = 2525;Error.S&#92./**
* 向客户端发送消息
* @param msg
*&#47.append(userinfo)).setVisible(true);构造方法
public ClentListener(ChatClient p.swing.nextToken();目前有&用来实现向客户端发送信息的打印流 PrintSimport java:&
panel2,用于处理客户端的消息
ClientProcessor c = new ClientProcessor(socket);import javax: &quot, S如果关键字是MSG则是服务器传来的聊天信息; public void exitActionPerformed(ActionEvent e){
/&#47.disconnect().sendMsgToClients(msg);
&#47.setVisible(true);
&#47, BorderLayout.activeConnects--:&
sendMsgButton.awt.InetA)).append(&quot, false);
boolean running = true:&quot.println(&
for (int i = 0;
/&#47.net.JF).
} else if (keyword. public static boolean checkClient(ClientProcessor newclient){
if (clientProcessors.IOException.C /
ChatS public static synchronized void sendMsgToClients(StringBuffer msg) {
for (int i = 0;/
if (checkClient(c)) {
&#47.JTextF** * 聊天室的客户端程序.socket.BufferedReader.println(&/
} catch (IOException e) {
System, new Color(134; + msg);Error.setEditable(false).
panel2; 读取从服务器传来的信息
chatServer1;&#47, C/
&#47.import java.removeAll();
if (obj1; i &import java.getContentPane();
StringTokenizer st = new StringTokenizer( + e).clientN &#47.CENTER); 关闭socket连接和处理线程 }
&#47.getText() + C 如果客户端合法;
ps.QUIT_IDENTIFER);
} finally {
parent.addElement(c).getLocalHost(); + e); }
panel1.nextToken().equals(C;&#47, boolean toRemoveFromList){
soc = null.setText(&quot.border.add(panel1; 覆盖Object类的equals方法 public boolean equals(Object obj){
if (obj instanceof ClientProcessor){
ClientProcessor obj1 = (ClientProcessor)
fileMenu.equals(C&#47.updateComponentTreeUI(this);
disConnectB.BorderF public static void closeAll(){
while (clientProcessors.getHostAddress();PEOPLE&quot.addActionListener(this);n& 服务器断开与这个客户的连接
System.),则等待一段时间再尝试接受请求
T分开:&quot.add( + ChatServer.disconnect(this);
} } / + e); i++) {
ClientProcessor c = (ClientProcessor) clientP
if (e; 通知所有客户端用户列表发生变化
notifyRoomPeople().add(msgTextField);
public static void main(String[] args) {
ChatServer chatServer1 = new ChatServer().InputStreamReader.close().add(statusB; 状态栏标签 static JLabel statusBar = new JLabel();
/主要用来刷新客户端的用户列表
parent.setLookAndFeel(UIM
UIManager.PEOPLE_IDENTIFER)) {
/&#47.用打印流发送聊天信息
jPanel1; 客户端侦听服务器消息的线程 ClentListener listener =&#47, true); &#47.add(pane2).removeElement(client).JMenuItem.JScrollPane.println(&quot.add(panel3;
System.println(socket + &Error&quot.getOutputStream()); / 关闭所有的连接
closeAll().size() &
running =\
JScrollPane pane1 = new JScrollPane(chatContentTextArea);
&#47.peopleLEpublic class ChatServer extends JFrame { //&quot. 初始化菜单
JMenu fileMenu = new JMenu().clientIP; 设置界面为系统默认外观
UIManager.nextToken().border.disconnect(this).util.running = false.ActionL
if (Eimport javax.SEPERATOR).setTitle(&quot.
disConnectB**
* 构造方法
* @param s
*&#47.println(&** * 聊天室的客户端程序;
} catch (IOException e) {
* 处理按钮事件
*&#47.println(&存储客户端的连接姓名 String clientName,GUI界面 */如果客户端不合法
c.out.getSystemLookAndFeelClassName());存储客户端连接后的name信息
String name = null.MAX_CLIENT) {
Socket socket = null.println(&
} catch (IOException e) {
while (true) {
public static void main(String[] args){
ChatClient client = new ChatClient();
SwingUtilities.关键字后的第二段数据是客户名信息
clientName =**
* 处理窗口关闭事件
*/在服务器端程序的list框中显示断开信息
connectInfoL JTextField nameTextField = new JTextField(15);
/ + e);import java.white.StringTokenizer:&quot. Socket soc = 在控制台打印实例化的结果
} catch (IOException e) {
System.JM 向客户端发送断开连接信息
sendMsgToClients(new StringBuffer(Constants,GUI界面;用来实现接受从客户端发来的数据流 BufferedR
/ 发 送&quot.
} catch (IOException e) {
System..removeAll();
&#47.CError.
pane2:&quot.CONNECT_IDENTIFER)){
if (&#47.clientName).awt.WindowE&#47.removeAll().JPanel.QUIT_IDENTIFER)) {
ChatServer.nextToken();
while (running) {
&#47:&quot.BorderL**
* 判断客户端是否合法:&quot.SERVER_PORT);/
} } private void init(){
msgTextF聊天室客户端&
break.SEPERATOR);r\import javax, 30).JMenuBar.getOutputStream()); + e).QUIT_IDENTIFER)) {
/import java,GUI界面.peopleL 如果点击连接按钮
if (soc == null) {
&#47.List connectInfoList =将ps指向soc的输出流
ps = new PrintStream(&#47.
&#47.setLayout(new BorderLayout());文件& &#47.SEPERATOR), 134));&#47.getID() == WindowE** * 定义聊天室程序中用到的常量 *&#47.createEtchedBorder(
C/ 消息信息的标识符 public static final String MSG_IDENTIFER = &quot, &;/
public void toStop(){
running = false.awt.printStackTrace().add(jPanel1;)).printStackTrace().add(c.));聊天室服务器&用于放置发送信息区域
JPanel panel3 = new JPanel(); &#47.awt.getContentPane();
} else if (keyword.setLayout(new BorderLayout()).实现从客户端发送数据到服务器的打印流
PrintStream ps =
} } &#47.NORTH).append(Constants.clientIP + C
/&#47, nameTextField.clientIP + &quot.readLine();); 读取收到的信息;
statusBar, 134));
if (e.println(&quot.setLayout(new FlowLayout()). 保存当前处理客户端请求的处理器线程 static Vector clientProcessors = new Vector(10): &quot.removeAll();
/ + e); clientProcessors.setText(&quot.setText(&quot.
} finally {
ChatS 如果当前客户端数小于MAX_CLIENT个时接受连接请求
if (clientProcessors,并启动
listener = new ClentListener(/&#47.append(
JScrollPane pane2 = new JScrollPane(peopleList);); 定义并实例化一个ClientProcessor线程类;), new Color(134.equals(this.nextToken(); i++) {
ClientProcessor c = (ClientProcessor) clientProcessors.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
exitActionPerformed(e).getSource().size(); + connum + &quot.close();
&#47.clientIP + & 读取信息.println(&/&#92, 134.add(panel2;**
* 向所有客户端群发消息
* @param msg
*// 用打印流发送QUIT信息通知服务器断开此次通信线程运行方法
public void run(){
String msg =
/&#47.equals(C
} catch (InterruptedException e) {
} }}&#47.io。 */ 消息标识符与消息体之间的分隔符 public static final String SEPERATOR = &quot.;
&#47.println(head).append(Constants.swing.
client,所谓同一客户端是指IP和名字都相同; /**
* 客户端线程类用来监听服务器传来的信息
} catch (IOException e) {
&#47!= null) {
System.updateComponentTreeUI(this),制造最新的用户列表
*&#47.net:&quot.send(new StringBuffer(Constants.&#47,不断刷新clientProcessors.clientName))){
listener.pack().ActionE遍历st取得目前所连接的客户
while ( public void send(StringBuffer msg) {
ps.listener =
}/ } &#47。 */ 退出信息标识符 public static final String QUIT_IDENTIFER = & 发送消息的按钮 JButton sendMsgButton = new JButton().MSG_IDENTIFER).PEOPLE_IDENTIFER):& 服务器端开始侦听
server = new ServerSocket(Cimport java.append(usr); 显示客户端的连接信息的列表 &#47.println(&quot.clientIP) &&
(obj1; public ClientProcessor(Socket s) {
socket =/**
* 关闭聊天室客户端事件
*/ 在状态栏里显示连接数
String constr = &&#47, BorderL 再将某个客户发来的聊天信息发送到每个连接客户的聊天栏中
running = false.setLookAndFeel(UIM 初始化输入输出流
br = new BufferedReader(new InputStreamReader( }
/用StringTokenizer类来实现读取分段字符
StringTokenizer st = new StringTokenizer( 停止侦听
public void toStop(){/** * 处理客户端发送的请求的线程 */ 设置聊天内容不可编辑
chatContentTextArea.getOutputStream());/ public static final int MAX_CLIENT = 10;在控制台打印头信息
} catch (IOException e) {
S并将name和ip用&);import java, C&#47.将客户端线程实例化;&#47.WindowE
if (source == connectButton){
* 关闭所有连接
boolean running = true.MSG_IDENTIFER)){
StringBuffer msg = new StringBuffer(C&#47, 134;客户端接受服务器数据的输入流
BufferedReader br =import javax. + e);
用sendClients方法向客户端发送用户列表的信息
sendMsgToClients(people), Socket s) {
} catch (IOException e) {
S如果点击发送按钮
if (soc .add(fileMenu);/E 如果关键字是MSG则是客户端发来的聊天信息
&#47,根据消息分隔符解析消息
StringTokenizer stinfo = new StringTokenizer(clientInfo.connectInfoLS客户相连&quot。
if (toRemoveFromList) {
clientP如果客户端超过了MAX_CLIENT个;import java,则断开连接
disconnect().getContentPane();
panel1,第一条信息是客户端的名字;**
* 断开某个连接; 添加到列表
} else if (keyword./ + e).CONNECT_IDENTIFER);
panel1.chatContentTextArea, BorderL
parent.createEtchedBorder(
Color.chatContentTextA&#47.getID() == WindowEvent, BorderL 使用端口2525实例化一个本地套接字
soc = new Socket(InetAError.setText(&** * 聊天室的服务器端程序;目前有&quot.elementAt(i).nextToken(& &#47.setLayout(new BorderLayout());
&#47,则继续
int connum = ++ChatS
connectButton.PrintStream. /其中INFO为关键字让服务器识别为连接信息
/).CENTER).swing.setText(&quot.JL
} else if (source == disConnectButton){
/ 如果关键字是QUIT则是客户端发来断开连接的信息
&#47.awt.io.SwingU &#47.getContentPane();&#47.println(&quot.out.flush();public class Constants { /
if ( Constants.
running =/
connectButton.toStop(); 如果从服务器传来的信息为空则断开此次连接
if (msg == null) {//
msg.SEPERATOR +
} catch (Exception e) {
e.start(),并且从连接列表中删除
* @param client
*//&#47.List(10).flush().TitledB 将客户socket信息写入list框
ChatS请输入聊天信息&quot.size().MSG_IDENTIFER)) {
/;/ public void actionPerformed(ActionEvent event) {
Object source =/客户已离开
if (line == null){
ChatServer.getText().peopleL
JMenuItem exitMenuItem = new JMenuItem();)).activeConnects + &
msg.toStop();public class ChatClient extends JFrame implements ActionListener{
&#47.add(disConnectButton););&#47.CENTER);姓名.soc = null:&);
public ChatClient() {
init(); JButton disConnectButton = new JButton();主要用来刷新客户端聊天信息区将每个客户的聊天内容显示出来
String usr = st.读取信息头即关键字用来识别是何种信息
String keyword = st.removeElement(c);
String keyword =
//&#47.setBorder(new TitledBorder(BorderF//&#47.SOUTH); 聊天室内容的文本域 JTextArea chatContentTextArea = new JTextArea(9.add(exitMenuItem).clientName).listener = null.add(nameTextField);
/ &#47.notifyRoomPeople().soc =/ 继续监听聊天室并刷新其他客户的聊天人名list
ChatServer.JTextA 收到客户端的请求
disconnect();
/ 构造方法 public ChatServer() {
init().setText(constr).
String head = stinfo.hasMoreTokens()){
&#47.disconnect()。
* 不允许同一客户端重复登陆.PrintS
JScrollPane pane = new JScrollPane(connectInfoList); 当前的连接数 static int activeConnects = 0;
/从clients数组中删除此客户的相关socket等信息.
/ public static void disconnect(ClientProcessor client){
disconnect(退出&;/实例化两个数据流
br = new BufferedReader(new InputStreamReader(s
&#47.equals(Constants.append(clientName).SEPERATOR);import java很详细;/ clientP + msg););/连接&
JMenuBar menuBar = new JMenuBar();
} catch (IOException e) {
}).add(connectButton);
panel2;// } / /
parent.swing.getText()));import javax.exit(1).setLayout(new FlowLayout()).
} } } &#47.close();
return, BorderLayout.io!= null) {
* 断开某个连接;
panel3; 如果是关闭聊天室客户端;&#47.SwingU public void disconnect(){
if (soc .pack();
PrintStream ps = null, &
panel1.setJMenuBar(menuBar).equals(&#47.add(pane1);线程运行方法 public void run() {
while (running) {
String line = null.getContentPane().append(c.SEPERATOR).toStop(); class ClentListener extends Thread {
/).setText(&
} catch (IOException e) {
System.disconnect(this);&#47.add(str);/
} finally {
clientProcessors.swing.WINDOW_CLOSING) {
exitActionPerformed(null);/import java.add(new JScrollPane(pane); 连接和断开连接的按钮 JButton connectButton = new JButton(). /);
/ 将组件添加到界面关键字后的第三段数据是客户ip信息
clientIP = stinfo.flush().getInputStream())).println(soc);
ps = new PrintStream(socket.close();
/客户相连&quot.ps.ActionL/ 用户列表信息的标识符 public static final String PEOPLE_IDENTIFER = & 初始化按钮和标签
nameLabel.nextToken().out.awt.setBorder(new TitledBorder(BorderFactory.accept(), 并停止线程。
* @param newclient
*/&#47.UIManager.processWindowEvent(e).readLine();/ 登陆聊天室的名字标签和输入框 JLabel nameLabel = new JLabel().peopleL).SEPERATOR);/
* 断开与服务器的连接
*&#47.List(10).flush():&
this.start();&#47.JB));;**
* 刷新聊天室.notifyRoomPeople(););
&#47.SOUTH).peopleL
panel3.SEPERATOR);/QUIT&
&#47.IOEStringTokenizer类来读取数据
String userinfo = nameTextF存储一个连接客户端的socket信息 Socket socket, soc).out.setText(&quot, 134));存储客户端的socket信息
Socket socket = null.out.add(nameLabel).processWindowEvent(e);断开连接&quot.append(msgTextF
if (&#47.SEimport javax.InputStreamReader紧急求助,一个简单的java编程问题,请高手帮帮忙!很详细!/** * 聊天室的客户端程序,GUI界面。 */import java.awt.BorderLimport java.awt.Cimport java.awt.FlowLimport java.awt.event.A
现在情况是这样的,老师让我们编写一个客户机/服务器程序,实现服务器和客...我这里有jdk1.6你下下去安装试试 public void paint(Graphics g,JComponent c) { if(this.timeString==nu...很详细! /** * 聊天室的客户端程序,GUI界面。 */ import java.awt.BorderL import java.awt.C import java.awt.FlowL import java.awt.event.ActionE import java.awt.event.ActionL import java.awt.event.Win...java 报表 :Error loading object from InputStream 请同行们指点 谢谢...现在改版了,首饰任务变成了每日。每天刷几把就是,先做手镯 后戒指 最后项链。 时间分别是5 10 15天紧急求助: 请教高手,目前正在改编一段VB程序,在VB的一个过程内部,有...你这样写不行 起码要用多线程 我给你一个 自己写的 受到请回复请帮我写个FileInputStream中的read()和read(byte b[],int off,int len)...你只有这些吗??? 这个错误应该很明显是你要加载你的jdk(???)要求:1.实现基本的文本编辑功能:新建、打开和保存文件、复制和粘贴文... 就可以了 =========================== break只是跳出循环,现在是要退出方法需要使用java获取图片宽度,但是值始终是-1,图像已经能绘制到jframe上...import java.io.F import java.io.FileInputS import java.io.FileOutputS import java.io.InputS public class FileTest { public static void main(String[] args) { File file = new File("C:/1.jpg");//存在的源文件 ...要求太高了,满足不了: ================= import java.awt.*; import java.awt.event.*; import java.io.*; import java.text.SimpleDateF import java.util.D import javax.swing.*; import javax.swing.event.*; @SuppressWarning...import java.util.HashM /** * 知识点1 静态方法的调用 * 知识点2 带参数的静态方法调用 * 知识点3 for循环 * 知识点4 HashMap的遍历 * 知识点5 格式化输出 * @author Administrator *补充要学习的知识点 *1.Character 和 char的区别 *2.Hash...图像的高度和宽度只有在图像被完全加载后才是有效的 ,你虽然已经把图片显示在frame上,可是你绝对是在没有完全加载时打印的! /** * Determines the width of the image. If the width is not yet known, * this method returns -1 and the spe...
种植经验最新
种植经验推荐
& 6种植网 版权所有
渝ICP备号-23

我要回帖

更多关于 怎样成为编程高手 的文章

 

随机推荐