自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(1)
  • 资源 (27)
  • 收藏
  • 关注

原创 SQL语句查看字段类型及精度

--字段类型和精度 SELECT @type=t.name, @prec=c.prec FROM sysobjects o        JOIN syscolumns c on o.id=c.id        JOIN systypes t on c.xusertype=t.xusertype WHERE o.name = @SortTable AND c.name = @Sort

2014-06-13 14:16:52 3320

基于CNN+LSTM的短时交通流量预测方法

基于CNN+LSTM的短时交通流量预测方法

2022-03-15

天津大学2010年运筹学真题.pdf

天津大学2010年运筹学考研 真题.pdf

2020-03-18

天津大学2012运筹学真题.pdf

天津大学2012 运筹学考研 真题

2020-03-18

西北工业大学+运筹学.rar

西北工业大学 考研 运筹学真题

2020-03-18

Hadoop3.0分布式集群搭建(HA)详细文档.docx

详细描述Hadoop3.0 高可用分布式集群搭建。步骤清晰。

2018-05-22

阿里开发规范V1.11.pdf

阿里开发规范V1.11

2017-08-18

7天学会spring cloud教程.pdf

7天学会spring cloud教程

2017-06-08

javascript权威指南 第6版英文版(含源代码).rar

javascript权威指南 第6版英文版(含源代码).rar 详细讲解javascript

2014-05-07

7天搞定Java基础_课件ppt.rar

7天搞定Java基础_课件ppt.rar Java简单入门教程ppt

2014-05-07

构架师.pdf

教你如何成长为一个合格的构架师!祝你成功

2014-01-07

android 常用工具类

在开发中经常用到的一些android常用工具类,总结起来,收藏下!!

2013-08-29

Android手机平台移植与底层开发.pdf

Android手机平台移植与底层开发.pdf

2013-06-26

Windows Phone 8开发技巧与案例精解.pdf

Windows Phone 8开发技巧与案例精解.pdf

2013-06-26

md5算法C#的实现

md5算法C#的实现

2013-06-16

可扩展标记语言.pdf

可扩展标记语言.pdf可扩展标记语言.pdf可扩展标记语言.pdf可扩展标记语言.pdf可扩展标记语言.pdf可扩展标记语言.pdf

2013-06-16

W3CSchool全套Web开发手册.chm

W3CSchool全套Web开发手册.chm

2013-06-16

WPF编程入门

WPF编程入门

2013-06-16

java课程设计范例.jsp.doc

java课程设计范例.jsp.doc 帮助你编写详细的课程设计

2012-09-20

java中国象棋代码(单机版).

java中国象棋代码(单机版)的详细代码解说

2012-09-20

疯狂Java实战演义(光盘源代码)

疯狂Java实战演义(光盘源代码) CSDN

2012-09-20

Thinking in Java 4th Edition

Thinking in Java 4th Edition

2012-09-20

Java仿Vista界面风格的登录窗口

Java仿Vista界面风格的登录窗口Java仿Vista界面风格的登录窗口的详细代码

2012-09-20

WCF简单实例

wcf实例

2012-06-30

ppt转换成word软件

实用的ppt转化为word软件,小软件大用处。

2012-06-30

Android开发指南中文版

详细的安卓开发详解,手把手教给你。安卓开发入门。

2012-06-30

制作登录界面

/MainFrame.java import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MainFrame extends JFrame implements ActionListener{ private Container cont; private JPanel panelMenu; private JPanel panelToolBar; private JPanel panelCompent; private JButton btnLeft; private JButton btnCenter; private JButton btnRight; private JButton btnBorder; private JButton btnGrid; private JLabel labHit; private JMenuBar menuBar; private JMenu menuOperation; private JMenu menuHelp; private JMenuItem mItemFlowLeft; private JMenuItem mItemFlowCenter; private JMenuItem mItemFlowRight; private JMenuItem mItemBorder; private JMenuItem mItemGrid; private JToolBar toolBar; private JButton tBtnLeft; private JButton tBtnCenter; private JButton tBtnRight; private JButton tBtnBorder; private JButton tBtnGrid; public MainFrame(){ this.setTitle("第一个界面"); this.setBounds(300, 300, 600, 450); this.setDefaultCloseOperation(this.EXIT_ON_CLOSE); cont = this.getContentPane(); // cont.setLayout(new GridLayout(3, 9)); cont.setLayout(null); initPanel(); initMenu(); initToolBar(); initCompent(); addMenu(); addCompent(); // addBorderCompent(); this.setVisible(true); } public void initPanel(){ panelMenu = new JPanel(); panelMenu.setLayout(new FlowLayout(FlowLayout.LEFT)); panelMenu.setBounds(0, 0, 600, 30); panelToolBar = new JPanel(); panelToolBar.setLayout(new FlowLayout(FlowLayout.LEFT)); panelToolBar.setBounds(0, 30, 600, 50); panelCompent = new JPanel(); panelCompent.setLayout(new GridLayout(3, 2)); panelCompent.setBounds(0, 80, 600, 350); cont.add(panelMenu); cont.add(panelToolBar); cont.add(panelCompent); } public void initMenu(){ menuBar = new JMenuBar(); menuOperation = new JMenu("布局操作"); menuHelp = new JMenu("帮助"); mItemFlowLeft = new JMenuItem("流式左布局"); mItemFlowLeft.addActionListener(this); mItemFlowCenter = new JMenuItem("流式居中"); mItemFlowCenter.addActionListener(this); mItemFlowRight = new JMenuItem("流式右布局"); mItemFlowRight.addActionListener(this); mItemBorder = new JMenuItem("边界布局"); mItemBorder.addActionListener(this); mItemGrid = new JMenuItem("网格布局"); mItemGrid.addActionListener(this); } public void initToolBar(){ toolBar = new JToolBar(); tBtnLeft = new JButton(new ImageIcon("COPY.jpg")); tBtnLeft.addActionListener(this); tBtnLeft.setToolTipText("流式左布局"); tBtnCenter = new JButton(new ImageIcon("HELP.jpg")); tBtnCenter.addActionListener(this); tBtnCenter.setToolTipText("流式居中"); tBtnRight = new JButton(new ImageIcon("find.jpg")); tBtnRight.addActionListener(this); tBtnRight.setToolTipText("流式右布局"); tBtnBorder = new JButton(new ImageIcon("CUT.jpg")); tBtnBorder.addActionListener(this); tBtnBorder.setToolTipText("边界布局"); tBtnGrid = new JButton(new ImageIcon("OPEN.jpg")); tBtnGrid.addActionListener(this); tBtnGrid.setToolTipText("网格布局"); toolBar.add(tBtnLeft); toolBar.add(tBtnCenter); toolBar.add(tBtnRight); toolBar.add(tBtnBorder); toolBar.add(tBtnGrid); panelToolBar.add(toolBar); } public void initCompent(){ btnLeft = new JButton("LEFT"); btnLeft.addActionListener(this); btnRight = new JButton("RIGHT"); btnRight.addActionListener(this); btnCenter = new JButton("CENTER"); btnCenter.addActionListener(this); btnBorder = new JButton("BORDER"); btnBorder.addActionListener(this); btnGrid = new JButton("GRID"); btnGrid.addActionListener(this); labHit = new JLabel("提示"); } public void addMenu(){ menuOperation.add(mItemFlowLeft); menuOperation.add(mItemFlowCenter); menuOperation.add(mItemFlowRight); menuOperation.add(mItemBorder); menuOperation.add(mItemGrid); menuBar.add(menuOperation); menuBar.add(menuHelp); panelMenu.add(menuBar); } public void addCompent(){ panelCompent.add(btnLeft); panelCompent.add(btnCenter); panelCompent.add(btnRight); panelCompent.add(btnBorder); panelCompent.add(btnGrid); panelCompent.add(labHit); } public void addBorderCompent(){ panelCompent.add(btnLeft, "West"); panelCompent.add(btnCenter, "Center"); panelCompent.add(btnRight, "East"); panelCompent.add(btnBorder, "North"); panelCompent.add(btnGrid, "South"); } public void actionPerformed(ActionEvent aEvt){ if((btnLeft == aEvt.getSource()) ||(mItemFlowLeft == aEvt.getSource()) ||(tBtnLeft == aEvt.getSource())){ panelCompent.setLayout(new FlowLayout(FlowLayout.LEFT)); labHit.setText("流式布局管理器左靠齐"); } else { if((btnRight == aEvt.getSource()) ||(mItemFlowRight == aEvt.getSource()) ||(tBtnRight == aEvt.getSource())){ panelCompent.setLayout(new FlowLayout(FlowLayout.RIGHT)); labHit.setText("流式布局管理器右靠齐"); } else { if((btnCenter == aEvt.getSource()) ||(mItemFlowCenter == aEvt.getSource()) ||(tBtnCenter == aEvt.getSource())){ panelCompent.setLayout(new FlowLayout(FlowLayout.CENTER)); labHit.setText("流式布局管理器中靠齐"); } else { if((btnBorder == aEvt.getSource()) ||(mItemBorder == aEvt.getSource()) ||(tBtnBorder == aEvt.getSource())){ panelCompent.setLayout(new BorderLayout()); addBorderCompent(); labHit.setText("边界布局管理器"); } else{ if((btnGrid == aEvt.getSource()) ||(mItemGrid == aEvt.getSource()) ||(tBtnGrid == aEvt.getSource()) ){ panelCompent.setLayout(new GridLayout(3, 2)); // addBorderCompent(); labHit.setText("网格布局管理器"); } } } } } } } //LoginFrame.java import javax.swing.*; import java.awt.*; import java.awt.event.*; class LoginFrame extends JFrame implements ActionListener{ private Container cont; private JLabel labUserName; private JLabel labPassword; private JTextField txtUserName; private JTextField txtPassword; private JButton btnOK; private JButton btnCancel; public LoginFrame(){ this.setTitle("登录界面"); this.setSize(300, 250); this.setLocation(300, 300); this.setDefaultCloseOperation(this.EXIT_ON_CLOSE); initCont(); initCompent(); addCompent(); this.setVisible(true); } public void initCont(){ cont = this.getContentPane(); cont.setLayout(null); } public void initCompent(){ labUserName = new JLabel("用户名:"); labPassword = new JLabel("密 码:"); txtUserName = new JTextField(); txtPassword = new JPasswordField(); btnOK = new JButton("登录"); btnCancel = new JButton("重置"); } public void addCompent(){ cont.add(labUserName); labUserName.setBounds(40,40,80,30); cont.add(labPassword); labPassword.setBounds(40,90,80,30); cont.add(txtUserName); txtUserName.setBounds(120,40,120,30); cont.add(txtPassword); txtPassword.setBounds(120,90,120,30); cont.add(btnOK); btnOK.addActionListener(this); btnOK.setBounds(60,170,80,30); cont.add(btnCancel); btnCancel.addActionListener(this); btnCancel.setBounds(160,170,80,30); } public void actionPerformed(ActionEvent aEvt){ if(aEvt.getSource() == btnOK){ if((txtUserName.getText().equals("denghong")) &&(txtPassword.getText().equals("123"))){ new MainFrame(); this.dispose(); } } else{ if(aEvt.getSource() == btnCancel){ labUserName.setText(""); labPassword.setText(""); } } } } //Test.java public class Test{ public static void main(String[] args){ new LoginFrame(); } }

2011-11-23

制作小动画

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Animation extends JFrame implements Runnable,ActionListener{ private Container cont; private JButton btnUp; private JButton btnDown; private ImageIcon imgPlane; private ImageIcon imgBullet; private int planeX; private int planeY; private int bulletX; private int bulletY; private int planeSpeed; private int bulletSpeed; private int planeChangeSpeed; private Thread thread; public Animation(){ this.setBounds(30, 30, 400, 300); this.setDefaultCloseOperation(this.EXIT_ON_CLOSE); cont = this.getContentPane(); cont.setLayout(null); imgPlane = new ImageIcon("find.jpg"); imgBullet = new ImageIcon("bullet.jpg"); planeX = 0; planeY = 150; bulletX = 400; bulletY = 150; planeSpeed = 8; bulletSpeed = 8; planeChangeSpeed = 6; btnUp = new JButton("up"); btnDown = new JButton("down"); btnUp.setBounds(0, 240, 80, 30); btnDown.setBounds(90, 240, 80, 30); btnUp.addActionListener(this); btnDown.addActionListener(this); cont.add(btnUp); cont.add(btnDown); thread = new Thread(this); thread.start(); this.setVisible(true); } public void paint(Graphics grp){ super.paint(grp); imgPlane.paintIcon(this, grp, planeX, planeY); imgBullet.paintIcon(this, grp, bulletX, bulletY); } public void run(){ while((bulletX > 0) &&(planeX < 400)){ repaint(); planeX = planeX + planeSpeed; bulletX = bulletX - bulletSpeed; try{ Thread.sleep(200); }catch(Exception e){} } thread = null; } public void actionPerformed(ActionEvent aEvt){ JButton ob=(JButton)aEvt.getSource(); if(ob==btnUp){ planeY-=planeChangeSpeed; } if(ob==btnDown){ planeY+=planeChangeSpeed; } } public static void main(String args[]){ new Animation(); } }

2011-11-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除