当前位置: 首页 > news >正文

哪家做网站公司最好南京江宁网站建设

哪家做网站公司最好,南京江宁网站建设,wordpress调用自定义文章类型文章,建筑企业培训课程JAVA自学笔记25 1、GUI 1#xff09;图形用户接口#xff0c;以图形的方式#xff0c;来显示计算机操作的界面#xff0c;更方便更直观 2#xff09;CLI 命令行用户接口#xff0c;就是常见的Dos#xff0c;操作不直观 3#xff09; 类Dimension 类内封装单个对象… JAVA自学笔记25 1、GUI 1图形用户接口以图形的方式来显示计算机操作的界面更方便更直观 2CLI 命令行用户接口就是常见的Dos操作不直观 3 类Dimension 类内封装单个对象组件中组件的宽度和高度精确到整数 Dimension(int width,int height); 类Point //窗体案例 Frame fnew Frame();//也可通过带参构造设置标题String title,//设置窗体标题 f.setTitle(dd); //设置窗体大小 //f.setSize(100,200); Dimension dnew Dimension(100,200); //设置窗体位置//f.setLocation(400,200); Point pnew Point(400,200); f.location(p);//f.setBounds(int x.int y,int width,int height);//同时设置坐标及长宽Thread.sleep(3000);//休眠3秒再弹出 f.setVisible(true);2、事件监听器 1把事件源和事件关联起来 2 //窗体关闭案例 Frame fnew Frame(); f.setTitle(dd); f.setBounds(100200300,400);/ Thread.sleep(3000); //事件监听 f.addWindowListener(new WindowListener() { public void WindowClosing(WindowEvent e){ System.exit(0); } }); f.setVisible(true);3)适配器设计模式 接口须重写方法较多且不需都实现时可提供一个适配器类仅仅空实现即可在实现类重写即可 接口–适配器–实现类 WindowAdapter 适配器类 //窗体关闭案例 Frame fnew Frame(); f.setTitle(dd); f.setBounds(100200300,400); Thread.sleep(3000);f.addWindowListener(new WindowAdapte(){ public void windowClosing(WindowEvent e);{ System.exit(0); } }); f.setVisible(true);4布局 //窗体添加按钮并对按钮添加事件 //使用流式布局 Frame fnew Frame(); f.setTitle(dd); f.setBounds(100200300,400); Thread.sleep(3000); //设置布局为流式布局 f.setLayout(new FlowLayout());//创建按钮对象 Button bunew Button(按钮); bu.setSize(10,20);//把按钮添加到窗体//设置窗体可以关闭 f.addWindowListener(new WindowAdapte(){ public void windowClosing(WindowEvent e);{ System.exit(0); } });//设置点击事件 bu.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ System.out.println(success); } }); f.setVisible(true); //把文本框的值转移到文本域 //创建窗体对象 Frame fnew Frame(数据转移); //设置窗体属性和布局 f.setBounds(100,500,633,100); f.setLayout(new FlowLayout());//创建文本框 final TextField tfnew TextField(20);//文本框内可放20个字符 //创建按钮 Button bunew Button(数据转移); //创建文本域 final TextAreas tanew TextArea(10,40); // //对按钮添加事件 bu.addActionListener(new ActionListener)(){ ppublic void actionPerformed(ActionEvent e){ //获取文本框的值 String tf_strtf.getText().trim();//设置给文本域并换行 ta.append(tf_stf\r\n); } //获取光标 tf.requestFocus();//清空文本框数据 tf.setText(); }); //把组件添加到窗体 f.add(tf); f.add(bu); f.add(ta);//设置窗体关闭 f.addWindowListener(new WindowAdapte(){ public void windowClosing(WindowEvent e);{ System.exit(0); } }); //设置窗体显示 f.setVisible(true); //更改背景色 //创建窗体对象 final Frame fnew Frame(更改背景色); //设置窗体属性和布局 f.setBounds(100,500,633,100); f.setLayout(new FlowLayout());//创建四个按钮 Button redButtonnew Button(red);f.add(redButton);//设置窗体关闭 f.addWindowListener(new WindowAdapte(){ public void windowClosing(WindowEvent e);{ System.exit(0); } }); //对按钮添加动作事件 /*redButton.addActionLostener(new ActionLister(){ public void actionPerformed(ActionEvent e){ f.setBackground(Color.RED); } });*///对按钮添加鼠标点击事件 /*redButton.addMouseListener(new MouseAdapter(){ public mouseClicked(MouseEvent e){ f.setBackground(color.RED); } });*///对按钮添加鼠标的进入事件 redButton.addMouseListener(new MouseAdapter)(){ public void mouseEntered(MouseEvent e){ f.setBackground(color.RED); } });//对按钮添加鼠标的离开事件 redButton.addMouseListener(new MouseAdapter)(){ public void mouseExited(MouseEvent e){ f.setBackground(color.WHITE); } });//设置窗体显示 f.setVisible(true); //控制文本框只能输入数字字符 //创建窗体对象 final Frame fnew Frame(只能输入数字字符); //设置窗体属性和布局 f.setBounds(100,500,633,100); f.setLayout(new FlowLayout());//创建Label标签对象 Label labelnew Label(请输入QQ号码仅为数字); TextFiled tfnew TextField(40);//为文本框添加事件 tf.addKeyListener((new) KeyAdapter({ public void KeyPressed(KeyEvent e){ char che.getKeyChar(); if(!(ch0ch9)){} e.consume();//使用此事件以便不会按照默认的方式由产生的源代码来处理此事件 } });//添加到窗体上 f.add(label); f.add(tf);//设置窗体显示 f.setVisible(true); //设置窗体关闭 f.addWindowListener(new WindowAdapte(){ public void windowClosing(WindowEvent e);{ System.exit(0); } }); 菜单组件 //一级菜单案例 //创建窗体对象 final Frame fnew Frame(只能输入数字字符); //设置窗体属性和布局 f.setBounds(100,500,633,100); f.setLayout(new FlowLayout());//创建菜单栏 MenuBar mbnew MenuBar();//创建菜单 Menu mnew Menu(文件); //创建菜单项 MenuItem minew MenuItem(退出系统); // m.add(mi); mb.add(m);//设置菜单栏 f.setMenuBar(mb);mi.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ System.exit(0); } });//设置窗体显示 f.setVisible(true); //设置窗体关闭 f.addWindowListener(new WindowAdapte(){ public void windowClosing(WindowEvent e);{ System.exit(0); } }); //设置多级别菜单 final Frame fnew Frame(设置多级菜单); //设置窗体属性和布局 f.setBounds(100,500,633,100); f.setLayout(new FlowLayout());//创建菜单栏 MenuBar mbnew MenuBar();//创建菜单 Menu m1new Menu(文件); Menu m2new Menu(更改名称); //创建菜单项 MenuItem mi1new MenuItem(退好好学习); MenuItem mi2new MenuItem(天天向上); MenuItem mi3new MenuItem(恢复标题); MenuItem mi4new MenuItem(退打开记事本); MenuItem mi5new MenuItem(退出系统); // m2.add(mi1); m2.add(mi2); m2.add(mi3);m1.add(m2); m1.add(mi4); m1.add(mi5);//设置菜单栏 f.setMenuBar(mb);//设置事件 mi5.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ System.exit(0); } });//设置事件 mi4.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ Runtime rRuntime.getRuntime(); r.exec(notepad); } });//设置事件 mi1.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ f.setTitle(mi1.getLabel()); } });//设置事件 mi2.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ f.setTitle(多级菜单); } });//设置事件 mi3.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ f.setTitle(mi1.getLabel()); } });//设置窗体关闭 f.addWindowListener(new WindowAdapte(){ public void windowClosing(WindowEvent e);{ System.exit(0); } });//设置窗体显示 f.setVisible(true); 4、Netbeans 1)界面开发常用 //修改窗体图标 public class UiUtill{ private Uiutil(){} public static void setFrameImage(JFrame jf){ //获取工具类对象 Toolkit tkToolKit.getDefaultToolKit(); //根据路径获取图片 Image itk.getImage(src\\cn\\itcast\\resource\\a.jpg); //给窗体设置图片 jf.setIconImage(i);} } //设置窗体居中 //获取工具对象 Toolkit tkToolkit.getDefaultTookit();//获取屏幕宽高 Dimension dtk.getScreenSize(); double screenWidthd.getWidth(); double screenHeightd.getHeight(); //获取窗体宽高 int frameWidthjf.getWidth(); int frameHeightjf.getHeight();//获取新的宽高 int width(int)(screenWidth-frameWidth)/2; int height(int)(screenHeight-frameHeight)/2; 转载于:https://www.cnblogs.com/Tanqurey/p/10485337.html
http://wiki.neutronadmin.com/news/389161/

相关文章:

  • 舟山 做企业网站做网站建设找哪家好
  • 网站开发网站说明怎么写html5 动态效果 手机网站
  • 中国空间站最新视频自己做网站网站资源哪里来
  • 自己做的网站与ie不兼容美团网站界面设计
  • 无锡网站建设 君通科技坪山网站建设服务
  • 重庆建网站诚选快忻科技悉心如需锦州网站建设
  • 官方网站欣赏微官网 入口
  • 北京网站建设过程网站怎么做数据接口
  • 图库素材网站模板为什么公司网站打不开
  • 建设京东商城网站中国能源建设集团有限公司级别
  • wordpress常常被用来做什么网站庆阳做网站
  • 网站建设 翰臣科技公司中建一局招聘网
  • 建设部网站 注册违规做汽车介绍视频的网站
  • 设计类哪个专业好网站内部链接如何进行优化建设
  • 网站相互推广怎么做设计公司起名两个字
  • 什么情况下网站需要备案网站开发与维护专业前景
  • 如何提升网站访问速度构建一个网站需要什么
  • 网站建设图片怎么调做农产品交易网站
  • 网站安全注意哪些问题吗手机网站制作注意事项
  • 做网站总结与体会wordpress the7汉化版
  • 二手交易网站建设内容策划微信网站模板免费下载
  • 手机网站建设一般要多少钱什么是大型门户网站
  • 深圳沙头角网站建设网站的后台管理
  • 网上设计网站石景山保安公司
  • 做汽车团购的网站广东建设厅网站
  • 泰州营销型网站广东网络建设有限公司
  • 化妆品网站模板常见网站颜色搭配
  • 厦门网站的建设域名ip查询入口官网
  • 网站建设颜色注意事项江苏网站seo设计
  • 少儿教育网站建设价格coupang入驻条件2022