摘要: 为图形填充渐变色:Graphics2D g2=(Graphics2D)g;GradientPaint gra=new GradientPaint(20, 20, Color.BLUE, 100,80,Color.cyan,true); g2.setPaint(gra); ... 阅读全文
posted @ 2015-04-26 10:10 ma_fighting 阅读(191) 评论(0) 推荐(0)
摘要: 绘制二次曲线: public void paint(Graphics g) { // TODO 自动生成的方法存根 super.paint(g); Graphics2D g2=(Graphics2D)g; QuadCurve2D.Double curle=new QuadCurve2D.... 阅读全文
posted @ 2015-04-25 21:24 ma_fighting 阅读(212) 评论(0) 推荐(0)
摘要: this is the code:public class paint extends JFrame{ public paint(){ setLayout(new FlowLayout()); setLocation(0, 0); setSize(200, 200); setDefaul... 阅读全文
posted @ 2015-04-23 22:05 ma_fighting 阅读(168) 评论(1) 推荐(0)
摘要: 关键代码:public class jbalistener implements ActionListener { @Override public void actionPerformed(ActionEvent arg0) { // TODO 自动生成的方法存根 String str... 阅读全文
posted @ 2015-04-21 21:18 ma_fighting 阅读(335) 评论(0) 推荐(0)
摘要: 关键代码:try { String str=Chat.getJt().getText().toString();//获取输入内容 String[] ipstr=str.split("[.]"); byte[] by=new byte[4]; for(int i=0;i<4;i++){ int m... 阅读全文
posted @ 2015-04-21 20:51 ma_fighting 阅读(1039) 评论(0) 推荐(0)
摘要: public class Chat extends JFrame { public static JTextField jt; public Chat(){ setLayout(new FlowLayout())); setLocation(200, 200); setSize(200, 2... 阅读全文
posted @ 2015-04-21 20:04 ma_fighting 阅读(285) 评论(0) 推荐(0)
摘要: protected void onCreate(Bundle savedInstanceState) { // TODO 自动生成的方法存根 super.onCreate(savedInstanceState); setContentView(R.layout.layout); img=(I... 阅读全文
posted @ 2015-04-11 19:17 ma_fighting 阅读(164) 评论(0) 推荐(0)
摘要: 1.先声明用户权限代码: 2.MainActivity中通过SensorEventListener接口来实... 阅读全文
posted @ 2015-04-08 18:57 ma_fighting 阅读(413) 评论(0) 推荐(0)
摘要: AlarmManager的使用机制有的称呼为全局定时器,有的称呼为闹钟。通过对它的使用,它的作用和Timer有点相似。都有两种相似的用法:(1)在指定时长后执行某项操作(2)周期性的执行某项操作在android系统中,底层系统提供了两种类型的时钟,软时钟与硬时钟,软时钟就是我们常说的Timer,硬时... 阅读全文
posted @ 2015-04-03 20:48 ma_fighting 阅读(271) 评论(1) 推荐(0)
摘要: xml文件:java代码:TextView textview2;DatePicker datep;Calendar calendar=Calendar.getInstance(); /* (非 Javadoc) * @see android.app.Activity#onCreate(androi... 阅读全文
posted @ 2015-04-02 14:50 ma_fighting 阅读(1013) 评论(0) 推荐(0)
历史天气查