欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    ssd4实验五实验报告.doc

    • 资源ID:35172214       资源大小:33.50KB        全文页数:5页
    • 资源格式: DOC        下载积分:10金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要10金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    ssd4实验五实验报告.doc

    实验五一、 实验目的 为进入时区编写一个接口程序二、 实验内容 将世界地图载入界面,通过下拉列表控件对时区进行选择,并在地图中显示,如下图(1)主界面(2)点击OK出现的界面三、 实验步骤1. 实验代码package mycode;import javax.swing.JOptionPane; * author Administratorpublic class exercise5 extends javax.swing.JFrame /* Creates new form exercise5 */ public exercise5() this.setResizable(false); initComponents(); this.setTitle("TIME/DATE");/设置标题 selectnum = -1; /* This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. SuppressWarnings("unchecked") / <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() jComboBox1 = new javax.swing.JComboBox(); jPanel1 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jCheckBox1 = new javax.swing.JCheckBox(); jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String "(GMT -12:00) Eniwetok, Kwajalein ", "(GMT -11:00) Midway Island, Samoa ", "(GMT -10:00) Hawaii ", "(GMT -09:00) Alaska ", "(GMT -08:00) Pacific Time (US and Canada); Tijuana ", "(GMT -07:00) Arizona ", "(GMT -07:00) Mountain Time (US and Canada) ", "(GMT -06:00) Central Time (US and Canada) ", "(GMT -06:00) Mexico City, Tegucigalpa ", "(GMT -06:00) Saskatchewan ", "(GMT -05:00) Bogota, Lima ", "(GMT -05:00) Eastern Time (US and Canada) ", "(GMT -05:00) Indiana (East) ", "(GMT -04:00) Atlantic Time (Canada) ", "(GMT -04:00) Caracas, La Paz ", "(GMT -03:30) Newfoundland ", "(GMT -03:00) Brasilia ", "(GMT -03:00) Buenos Aires, Georgetown ", "(GMT -02:00) Mid-Atlantic ", "(GMT -01:00) Azores, Cape Verde Is. ", "(GMT +00:00) Greenwich Mean Time; Dublin, Edinburgh, London, Lisbon ", "(GMT +00:00) Monrovia, Casablanca ", "(GMT +01:00) Berlin, Stockhold, Rome, Bern, Brussels, Vienna ", "(GMT +01:00) Paris, Madrid, Amsterdam ", "(GMT +01:00) Prage, Warsaw, Budapest ", "(GMT +02:00) Athens, Helsinki, Istanbul ", "(GMT +02:00) Cairo ", "(GMT +02:00) Eastern Europe ", "(GMT +02:00) Harare, Pretoria ", "(GMT +02:00) Israel ", "(GMT +03:00) Baghdad, Kuwait, Nairobi, Riyadh ", "(GMT +03:00) Moscow, St. Petersburgh, Kazan, Volgograd ", "(GMT +03:00) Tehran ", "(GMT +04:00) Abu Dhabi, Muscat, Tbilisi ", "(GMT +04:30) Kabul ", "(GMT +05:00) Islamabad, Karachi, Ekaterinburg, Tashkent ", "(GMT +05:30) Bombay, Calcutta, Madras, New Delhi, Colombo ", "(GMT +06:00) Almaty, Dhaka ", "(GMT +07:00) Bangkok, Jakarta, Hanoi ", "(GMT +08:00) Beijing, Chongqing, Urumqi ", "(GMT +08:00) Hong Kong, Perth, Singapore, Taipei ", "(GMT +09:00) Tokyo, Osaka, Sapporo, Seoul, Yakutsk ", "(GMT +09:30) Adelaide (GMT +09:30) Darwin ", "(GMT +10:00) Brisbane, Melbourne, Sydney ", "(GMT +10:00) Guam, Port Moresby, Vladivostok ", "(GMT +10:00) Hobart ", "(GMT +11:00) Magadan, Solomon Is., New Caledonia ", "(GMT +12:00) Fiji, Kamchatka, Marshall Is. ", "(GMT +12:00) Wellington, Auckland " ); jComboBox1.setBorder(javax.swing.BorderFactory.createCompoundBorder(); jComboBox1.addActionListener(new java.awt.event.ActionListener() public void actionPerformed(java.awt.event.ActionEvent evt) jComboBox1ActionPerformed(evt); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 9, Short.MAX_VALUE) jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 168, Short.MAX_VALUE) jButton1.setText("OK"); jButton1.addActionListener(new java.awt.event.ActionListener() public void actionPerformed(java.awt.event.ActionEvent evt) jButton1ActionPerformed(evt); jButton2.setText("CANCEL"); jButton3.setText("APPLY"); jCheckBox1.setText("Automaticlly adjust clock for daynight saving changes"); jCheckBox1.setEnabled(false); jCheckBox1.addActionListener(new java.awt.event.ActionListener() public void actionPerformed(java.awt.event.ActionEvent evt) jCheckBox1ActionPerformed(evt); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/mycode/无标题.png"); / NOI18N jLabel2.setText("jLabel2"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane(); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 429, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(13, 13, 13) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(129, 129, 129) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(35, 35, 35) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jCheckBox1, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE) .addContainerGap() layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 168, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jCheckBox1) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2) .addComponent(jButton3) .addContainerGap(66, Short.MAX_VALUE) pack(); / </editor-fold> private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) selectnum = jComboBox1.getSelectedIndex(); selectstr = jComboBox1.getSelectedItem().toString(); for(int i=0;i<selectnum;i+) jLabel2.setLocation(jLabel2.getLocation().x+20, jLabel2.getLocation().y); private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) / TODO add your handling code here: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) / TODO add your handling code here: String str = "Time set to n" str +="=n" str +="Timezone=" str += selectstr; str +="noffset from GMT =" String str1 =String.format("%d", selectselectnum); str += str1; str +="n Auto daynight =Falsen" str +="=" JOptionPane.showMessageDialog(null, str); * param args the command line arguments public static void main(String args) java.awt.EventQueue.invokeLater(new Runnable() public void run() new exercise5().setVisible(true); / Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JCheckBox jCheckBox1; private javax.swing.JComboBox jComboBox1; private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; / End of variables declaration private int selectnum; private String selectstr; private int select = -720, -660, -600, -540, -480, -420, -420 , -360, -360, -360, -300 ,-300 ,-300, -240 , -240, -210 ,-180, -180, -120, -060, +000, +000, +060, +060, +060, +120, +120, +120 , +120, +120, +180, +180, +180, +240, +270, +300, +330, +360, +420, +480, +480, +540, +570, +570, +600, +600, +600, +660, +720, +720 ;2. 实验截图四、 实验总结此次实验学会了使用java的复选框等控件,对java桌面编程加深了了解

    注意事项

    本文(ssd4实验五实验报告.doc)为本站会员(叶***)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开