
2、定义显示文本的字体大小为22像素,离左侧和右侧的距离设置为自动,离顶部的距离设置为15像素。
3、用font标签在网页中插入要显示的文本。
4、由于显示的文本内容是动态控制的,所以设置一个标识符poemsi,用来动态表示显示的诗句。
5、然后,在网页中插入一个按钮。
6、按钮的高度为33像素,宽度为100像素,离左侧和右侧的距离为自动,离顶部的距离为20像素。
7、用type属性,定义按钮的类型为button。
8、定义按钮的标签为显示,单击后执行的函数为show。
9、按钮的背景色值为#aaeded,字体大小为20像素
public class mainFrame extends JFrame{JLabel jl = new JLabel("用户名称:")
JTextField jtf = new JTextField()
JPanel jp_group = new JPanel()
public loginFrame() {
try {
jbInit()com.hrkj.hrkjkf.common.mysession.dataTrf.getValue("main")
} catch (Exception exception) {
exception.printStackTrace()
}
}
private void jbInit() throws Exception {
jp_group.add(jl)
jp_group.add(jl)
this.add(jtf)
this.setTitle("窗体")
this.setSize(265, 185)
}
public static void main(String[] args) {
mainFrame mf = new mainFrame()
mf.setVsible(true)
}
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)