In this exercise you will finish the GUI for a "chat room" application. You will add menus to it and use a dialog box.
Create a choice box which lies below the send/quit buttons. Have it include a number of option to allow the user to choose a username to be used when chatting. Then modify the ActionListener for the send button. Have it prepend the the selected username to the message prior to adding it to the output textarea.
Create a menubar. Add a File menu and a Help menu.
Add a menu item called "quit" to the File menu. When that menu item is selected the program should be terminated.
Experiment with changing the color/font of the various components within the chat room frame.
Optional: Add a menu item called "about" to the Help menu. When that menu item is selected a modal Dialog should be displayed which tells the user about the chat program.谢谢大家了
Create a choice box which lies below the send/quit buttons. Have it include a number of option to allow the user to choose a username to be used when chatting. Then modify the ActionListener for the send button. Have it prepend the the selected username to the message prior to adding it to the output textarea.
Create a menubar. Add a File menu and a Help menu.
Add a menu item called "quit" to the File menu. When that menu item is selected the program should be terminated.
Experiment with changing the color/font of the various components within the chat room frame.
Optional: Add a menu item called "about" to the Help menu. When that menu item is selected a modal Dialog should be displayed which tells the user about the chat program.谢谢大家了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货