- 博客(0)
- 资源 (17)
- 收藏
- 关注
java 截屏 swing
使用java编写的截屏软件有如下基本功能,可以选中一个矩形区域,并且没有选中的区域为阴影部分,可以拖动选中区域,八个方向均可拉伸。是一个不错的截屏学习代码。此为源码
2012-08-06
Java 2实用教程(第三版)实验
实验1 一个简单的应用程序
1.答案:
【代码1】: System.out.println("你好,很高兴学习Java") ;
【代码2】: System.out.println("We are students") ;
2.模板代码
Hello.java
public class Hello
{
public static void main (String args[ ])
{
【代码1】 //命令行窗口输出"你好,很高兴学习Java"
A a=new A();
a.fA();
}
}
class A
{
void fA()
{
【代码2】 //命令行窗口输出"We are students"
}
}
2011-11-20
java _连接_oracle mysql的jar包
Class.forName(“com.mysql.jdbc.Driver”);
推荐这种方式,不会对具体的驱动类产生依赖。
DriverManager.registerDriver(com.mysql.jdbc.Driver);
会造成DriverManager中产生两个一样的驱动,并会对具体的驱动类产生依赖。
System.setProperty(“jdbc.drivers”, “driver1:driver2”);
虽然不会对具体的驱动类产生依赖;但注册不太方便,所以很少使用
2011-11-20
ASP动态网页设计教程
第1章 ASP设计基础
第2章 HTML语言
第3章 JavaScript脚本语言介绍
第4章 VBScript脚本语言介绍
第5章 ASP的内置对象
第6章 ASP组件
第7章 ASP的数据库存取组件及ADO技术
第8章 ASP动态网页设计开发实例
2011-11-16
C#类库查询手册
C#类库查询手册
Microsoft.Aspnet.Snapin
Microsoft.Build.Build Engine
Microsoft.Win32
System
Microsoft.SqlServer.Server等等...
2011-11-16
用C#制作的简易秒表
namespace StopWatch
{
public partial class Form2 : Form
{
DateTime examtime;
DateTime nowtime;
DateTime t = DateTime.Now;
int add = 0;
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
timer1.Enabled = false;
examtime = new DateTime(1, 1, 1, 0,0, 0);
labTime.Text = "0" + examtime.ToLongTimeString();
if (t.Hour < 10)
labT.Text = "0" + DateTime.Now.ToLongTimeString();
else
labT.Text = DateTime.Now.ToLongTimeString();
}
private void button2_Click(object sender, EventArgs e)
{
if (add < 1 )
{
starttime();
}
else
{
MessageBox.Show("记录已满,请清除记录后再开始记录!");
}
}
private void button1_Click(object sender, EventArgs e)
{
if (timer1.Enabled != false)
{
Add();
}
if (add >= 5)
{
MessageBox.Show("对不起!最多只能记录4条!!");
timer1.Enabled = false;
}
}
private void button3_Click(object sender, EventArgs e)
{
ClearTime();
add = 0 - 1;
Add();
stoptime();
}
private void button4_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void timer1_Tick(object sender, EventArgs e)
{
examtime = examtime.AddSeconds(1);
if (examtime.Hour < 10)
labTime.Text = "0" + examtime.ToLongTimeString();
else
labTime.Text = examtime.ToLongTimeString();
}
private void timer2_Tick(object sender, EventArgs e)
{
if(t.Hour<10)
labT.Text = "0"+DateTime.Now.ToLongTimeString();
else
labT.Text = DateTime.Now.ToLongTimeString();nowtime = nowtime.AddSeconds(1);
}
private void Add()
{
add = add + 1;
switch (add)
{
case 1:
textBox1.Text = "0" + examtime.ToLongTimeString();
timer1.Enabled = true;
break;
case 2:
textBox2.Text = "0" + examtime.ToLongTimeString();
timer1.Enabled = true;
break;
case 3:
textBox3.Text = "0" + examtime.ToLongTimeString();
timer1.Enabled = true;
break;
case 4:
textBox4.Text = "0" + examtime.ToLongTimeString();
Program.hash.add(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text);
timer1.Enabled = true;
timer1.Enabled = false;
break;
case 5:
default:
break;
}
}
private void ClearTime()
{
examtime = new DateTime(1, 1, 1, 0, 0, 0);
labTime.Text = "0" + examtime.ToLongTimeString();
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox1.Text = "0" + examtime.ToLongTimeString();
textBox2.Text = "0" + examtime.ToLongTimeString();
textBox3.Text = "0" + examtime.ToLongTimeString();
textBox4.Text = "0" + examtime.ToLongTimeString();
timer1.Enabled = false;
}
private void starttime()
{
timer1.Enabled = true;
}
private void stoptime()
{
timer1.Enabled = false;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void textBox5_TextChanged(object sender, EventArgs e)
{
}
private void labTime_Click(object sender, EventArgs e)
{
}
private void timeshow_Click(object sender, EventArgs e)
{
Form3 frm = new Form3();
frm.Show();
}
}
}
2010-11-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人