不知道是放在哪儿用了??但是基本就是这样的 如果还有其他的需求
可以稍微修改下就可以了
import java.applet.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class jj extends Applet //implements ActionListener { JLabel l1; JLabel l2; JTextField t1; JTextField t2; JButton button;
public void init() { resize(1000,70); l1=new JLabel("请输入单词:"); t1=new JTextField(10); l1=new JLabel("大写的单词为:"); t2=new JTextField(10); button=new JButton("大写");
l1.setFont(new Font("宋体",Font.BOLD,30)); l1.setForeground(Color.green); t1.setFont(new Font("宋体",Font.BOLD,30)); t1.setForeground(Color.black); t2.setFont(new Font("宋体",Font.BOLD,30)); t2.setForeground(Color.blue); button.setFont(new Font("宋体",Font.BOLD,30)); button.setForeground(Color.black); l2.setFont(new Font("宋体",Font.BOLD,30)); l2.setForeground(Color.red);
// btn.addActionListener(this);
this.add(l1); this.add(t1); this.add(button); this.add(l2); this.add(t2); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if(e.getSource()==button) { String str=t1.getText().toUpperCase(); t2.setText(str); } } }); }
}
测试结果
今天获得消息,vdsina上了AMD EPYC系列的VDS,性价比比较高,站长弄了一个,盲猜CPU是AMD EPYC 7B12(经过咨询,详细CPU型号是“EPYC 7742”)。vdsina,俄罗斯公司,2014年开始运作至今,在售卖多类型VPS和独立服务器,可供选择的有俄罗斯莫斯科datapro和荷兰Serverius数据中心。付款比较麻烦:信用卡、webmoney、比特币,不支持PayPal...
ZJI本月新上线了香港葵湾机房站群服务器,提供4个C段238个IPv4,支持使用8折优惠码,优惠后最低每月1400元起。ZJI是原Wordpress圈知名主机商家:维翔主机,成立于2011年,2018年9月更名为ZJI,提供中国香港、台湾、日本、美国独立服务器(自营/数据中心直营)租用及VDS、虚拟主机空间、域名注册等业务,所选数据中心均为国内普遍访问速度不错的机房。葵湾二型(4C站群)CPU:I...
数脉科技(shuhost)8月促销:香港独立服务器,自营BGP、CN2+BGP、阿里云线路,新客立减400港币/月,老用户按照优惠码减免!香港服务器带宽可选10Mbps、30Mbps、50Mbps、100Mbps带宽,支持中文本Windows、Linux等系统。数脉香港特价阿里云10MbpsCN2,e3-1230v2,16G内存,1T HDD 或 240G SSD,10Mbps带宽,IPv41个,...