不知道是放在哪儿用了??但是基本就是这样的 如果还有其他的需求
可以稍微修改下就可以了
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); } } }); }
}
测试结果
npidc全称No Problem Network Co.,Limited(冇問題(香港)科技有限公司,今年4月注册的)正在搞云服务器和独立服务器促销,数据中心有香港、美国、韩国,走CN2+BGP线路无视高峰堵塞,而且不限制流量,支持自定义内存、CPU、硬盘、带宽等,采用金盾+天机+傲盾防御系统拦截CC攻击,非常适合建站等用途。活动链接:https://www.npidc.com/act.html...
香港ceranetworks提速啦是成立于2012年的十分老牌的一个商家这次给大家评测的是 香港ceranetworks 8核16G 100M 这款产品 提速啦老板真的是豪气每次都给高配我测试 不像别的商家每次就给1核1G,废话不多说开始跑脚本。香港ceranetworks 2核2G 50G硬盘20M 69元/月30M 99元/月50M 219元/月100M 519元/月香港ceranetwork...
RAKsmart机房将于7月1日~7月31日推出“年中大促”活动,多重惊喜供您选择;爆款I3-2120仅30美金秒杀、V4新品上市,活动期间5折抢购、爆款产品持续热卖、洛杉矶+硅谷+香港+日本站群恢复销售、G口不限流量产品超低价热卖。美国VPS、日本VPS及香港VPS享全场7折优惠;爆款VPS $ 1.99/月限量秒杀,10台/天,售完即止, VPS 7折优惠码:VPS-TP-disRAKsmar...