java程序设计基础篇初学者必看小结 JTextField jtfName = new JTextField("Type Name Here"); jtfName.setBackground(Color.red); // Create a check box with text bold JCheckBox jchkBold = new JCheckBox("Bold"); jchkBold.setSize(10,50); // Create a radio button with text
import java.util.Calendar; import java.util.GregorianCalendar; import java.awt.*; import javax.swing.*; public class Ex extends JFrame{ public Ex() { super("倒计时"); setBackground(Color.WHITE); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds
Dimension ss = Toolkit.getDefaultToolkit().getScreenSize(); public ChatClient(){ super("登录聊天室"); pnlLogin = new JPanel(); this.getContentPane().add(pnlLogin); lblServer = new JLabel("服务器:"); lblPort = new JLabel("端口:"); lblName = new JLabel("用户名:");
import java.awt.*;//导入AWT包import java.awt.event.*;//导入事件处理包import javax.swing.*;//继承一个类public class Untitled1extends Frame {//构造各种组件TextField t = new TextField(" ");TextField tt = new TextField(" ");Label l = new Label(" 我的计算器");Panel p = new Panel(