《JAVA开发客户端服务器程序.ppt》由会员分享,可在线阅读,更多相关《JAVA开发客户端服务器程序.ppt(14页珍藏版)》请在三一办公上搜索。
1、Swing技术交流,2011-10-21,目录,一、Swing二、SWT,一、介绍,Swing是一个用于开发Java应用程序用户界面的开发工具包。它以抽象窗口工具包(AWT)为基础使跨平台应用程序。,二、利用Swing开发按钮、菜单,步骤:1、JButton2、JMenuBarJMenuJMenuItem3、给按钮就工具栏添加监听,三、利用Swing开发文本框,步骤:1、JTextArea,四、利用Swing开发复选框,步骤:1、JLabel2、JCheckBox,五、数据库中读取数据,步骤:1、JTable,六、图表显示,1、折线图2、柱状图3、饼状图4、仪表盘5、雷达图6、散点图,六、图表
2、显示,1、折线图DefaultCategoryDataset lcpd=LineChartsPanel.createDataset();JFreeChart lineChart=LineChartsPanel.createChartsPanel(lcpd);LineChartsPanel lcPanel=new LineChartsPanel(lineChart);lcPanel.setBounds(0,0,300,300);mf.addPanel(lcPanel);,六、图表显示,2、柱状图CategoryDataset bcpd=BarChartsPanel.createDataset()
3、;JFreeChart barChart=BarChartsPanel.createChartsPanel(bcpd);BarChartsPanel bcPanel=new BarChartsPanel(barChart);bcPanel.setBounds(300,0,300,300);mf.addPanel(bcPanel);,六、图表显示,3、饼状图PieDataset pd=PieChartsPanel.createDataset();JFreeChart pChart=PieChartsPanel.createChartsPanel(pd);PieChartsPanel pPanel
4、=new PieChartsPanel(pChart);pPanel.setBounds(600,0,300,300);mf.addPanel(pPanel);,六、图表显示,4、仪表盘DefaultValueDataset dvd=DialChartsPanel.createDataset();JFreeChart dialChart=DialChartsPanel.createChartsPanel(dvd);DialChartsPanel dPanel=new DialChartsPanel(dialChart);dPanel.setBounds(0,300,300,300);mf.ad
5、dPanel(dPanel);,六、图表显示,5、雷达图XYDataset xyd=PolarChartsPanel.createDataset();JFreeChart polarChart=PolarChartsPanel.createChartsPanel(xyd);PolarChartsPanel polarPanel=new PolarChartsPanel(polarChart);polarPanel.setBounds(300,300,300,300);mf.addPanel(polarPanel);,六、图表显示,6、散点图CategoryDataset cd=ParetoChartsPanel.createDataset();JFreeChart paretoChart=ParetoChartsPanel.createChartsPanel(cd);ParetoChartsPanel paretoPanel=new ParetoChartsPanel(paretoChart);paretoPanel.setBounds(600,300,300,300);mf.addPanel(paretoPanel);,