`
xiewanzhi
  • 浏览: 158314 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
Date date = new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int year = calendar.get(Calendar.YEAR); System.out.println(year);  

JSpinner使用方法

//日期 JSpinner dateSpinner = new JSpinner(); SpinnerDateModel dataModel = new SpinnerDateModel(); dataModel.setCalendarField(Calendar.YEAR); dateSpinner.setModel(dataModel); JSpinner.DateEditor dateEditor = new JSpinner.DateEditor(dateSpinner, "yyyy"); dateSpinner.setEditor(dateEditor) ...
1、整个系统三张表user(用户表)、group(分组表)、user_group(用户—分组) 2、user表字段有      id                                           主键      username                              用户名      password                              用户密码      information                            其它用户信息      一个用户可以有多了个分组 3、group表字段有       ...
好友类 public class Buddy {  private String qqId; private String qqName; private String qqImpresa; public Buddy(String qqId,String qqName,String qqImpresa){  this.setQqId(qqId);  this.setQqName(qqName);  this.setQqImpresa(qqImpresa); }  public String getQqId() {  return qqId; } public void setQqId(Str ...
当设置字体样式后,JTextPane中的所有字体都会改变: /** * 设置聊天信息输入框中字体的属性 */ private void initMsgInputTextPaneFont() { StyledDocument doc = msgInputTxtPane.getStyledDocument(); SimpleAttributeSet arrSet = new SimpleAttributeSet(); StyleConstants.setFontFamily(arrSet, msgFont.getFontFamily()); StyleCo ...
http://blog.163.com/xiexueyong1987@126/blog/#m=0
building workspace自动编译整个空间,Eclipse不象Jbuilder,是一个项目为一个域范围,它是以work space来衡量,一个work space可以有多个项目,那么编译work space就是编译其中所有项目,缺省是自动编译,或者将workspace所有项目都close project 取消自动编译,步骤如下:1. 取消 project -> build automatically 的选择 2. 重启eclipse
 JTextArea添加滚动条: public static JTextArea logTxtArea = new JTextArea(); JScrollPane logTxtScrollPane = new JScrollPane(logTxtArea); logTxtScrollPane.setPreferredSize(new Dimension(579, 304)); logTxtScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); logTxtScrollPane.s ...
1.类继承 Frame 2.创建控件(得到控件的实例) 3.将控件添加到窗体 5.将动作和控件绑定 控件.add..... 4.动作(创建适配器) mouse: class MFrame_add_mouseAdapter extends MouseAdapter {调用窗体类的执行方法_相应的动作方法} action: class MFrame_add_mouseAdapter implement ActionLister {调用窗体类的执行方法} ----------------------------------- swing 窗体关闭的六种方法 System.exit(0); Frame. ...

JFrame居中显示

方法一: setLocationRelativeTo(null); 注意:必须在整个frame初始化完成后再加上此语句,否则将显示在屏幕右下角 方法二: private Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); /** 屏幕宽度 */ private int screenWidth = screenSize.width; /** 屏幕高度 */ private int screenHeight = screenSize.height; jFrame.setLocation((s ...
Global site tag (gtag.js) - Google Analytics