SSD4实验六实验报告.doc
《SSD4实验六实验报告.doc》由会员分享,可在线阅读,更多相关《SSD4实验六实验报告.doc(25页珍藏版)》请在三一办公上搜索。
1、实验六一、 实验目的编写一个完整的DATE/TIME选择界面,能实现时间,时区选择对windows显示属性界面进行分析,写出UAR报告二、 实验内容编写以下程序项目,并包含以下内容要求: The second setting (0 to 59) The minute setting (0 to 59) The hour setting (in 24 hour time, 0 to 23) The day of the month The month of the year The year The index of the currently selected time zone The of
2、fset in minutes from GMT for the currently-selected time zone The title of the currently selected time zone 样例界面:对以下界面进行界面分析三、 实验步骤实验代码/* * To change this template, choose Tools | Templates * and open the template in the editor. */* * exercise5B.java * * Created on 2012-12-2, 16:13:25 */package myco
3、de;import java.awt.BasicStroke;import java.awt.BorderLayout;import java.awt.Color;import java.awt.Component;import java.awt.Graphics;import java.awt.Graphics2D;import java.util.Calendar;import java.util.GregorianCalendar;import java.util.TimerTask;import javax.swing.ButtonGroup;import javax.swing.JL
4、abel;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JSpinner;import javax.swing.JTable;import javax.swing.SpinnerNumberModel;import javax.swing.table.AbstractTableModel;import javax.swing.table.TableCellRenderer; / Variables declaration - do not modify / Variables declar
5、ation - do not modify/* * * author Administrator */public class exercise5B extends javax.swing.JFrame /* Creates new form exercise5B */ public exercise5B() calendar = Calendar.getInstance(); amorpm = calendar.get(Calendar.AM_PM);/获取当天是在上午还是下午 initComponents(); x=jLabel1.getLocation().x; y=jLabel1.ge
6、tLocation().y; 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) / private void initComponents() jButton1 = new javax
7、.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); jPanel4 = new javax.swing.JPanel(); jSpinner1 = new javax.swing.JSpinner(); jScrollPane1
8、 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jComboBox2 = new javax.swing.JComboBox(); jPanel5 = new javax.swing.JPanel(); jSpinner2 = new JSpinner(new SpinnerNumberModel(1,1,12,1); jSpinner3 = new JSpinner(new SpinnerNumberModel(1,0,59,1); jSpinner4 = new JSpinner(new Spinn
9、erNumberModel(1,0,59,1); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); jPanel6 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jComboBox1 = new javax.swing.JComboBox(); jPanel3 = new javax.swing.JPa
10、nel(); jLabel1 = new javax.swing.JLabel(); jCheckBox1 = new javax.swing.JCheckBox(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle(TIME/DATE); jButton1.setBackground(new java.awt.Color(153, 153, 153); jButton1.setFont(new java.awt.Font(宋体, 0, 14); jButton1.setText(ok)
11、; jButton1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED); jButton1.addActionListener(new java.awt.event.ActionListener() public void actionPerformed(java.awt.event.ActionEvent evt) jButton1ActionPerformed(evt); ); jButton2.setBackground(new java.awt.Col
12、or(153, 153, 153); jButton2.setFont(new java.awt.Font(宋体, 0, 14); jButton2.setText(cancel); jButton2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED); jButton2.addActionListener(new java.awt.event.ActionListener() public void actionPerformed(java.awt.event
13、.ActionEvent evt) jButton2ActionPerformed(evt); ); jButton3.setBackground(new java.awt.Color(153, 153, 153); jButton3.setFont(new java.awt.Font(宋体, 0, 14); / NOI18N jButton3.setText(apply); jButton3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED); jButton
14、3.addActionListener(new java.awt.event.ActionListener() public void actionPerformed(java.awt.event.ActionEvent evt) jButton3ActionPerformed(evt); ); jLabel3.setFont(new java.awt.Font(宋体, 0, 14); jLabel3.setText(Ponze Exampe); jTabbedPane1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.s
15、wing.border.BevelBorder.RAISED, null, java.awt.Color.darkGray, null, null); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(Date&Time); jPanel4.setFont(new java.awt.Font(宋体, 0, 14); jSpinner1.setEditor(new JSpinner.NumberEditor(jSpinner1, 0000); jSpinner1.setValue(new Integer(calendar
16、.get(Calendar.YEAR); jSpinner1.addChangeListener(new javax.swing.event.ChangeListener() public void stateChanged(javax.swing.event.ChangeEvent evt) jSpinner1StateChanged(evt); ); jScrollPane1.setPreferredSize(new java.awt.Dimension(45, 40); daysModel =new AbstractTableModel() public int getRowCount(
17、) return 6; public int getColumnCount() return 7; public String getColumnName(int col) switch (col) case 0: return WEEK_SUN; case 1: return WEEK_MON; case 2: return WEEK_TUE; case 3: return WEEK_WED; case 4: return WEEK_THU; case 5: return WEEK_FRI; case 6: return WEEK_SAT; default: return null; /设置
18、日期在哪显示 public Object getValueAt(int row, int column) / row-; Calendar calendar = (Calendar) exercise5B.this.calendar.clone(); calendar.set(Calendar.DAY_OF_MONTH, 1); int dayCount = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); int moreDayCount = calendar.get(Calendar.DAY_OF_WEEK) - 1; int index
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SSD4 实验 报告
链接地址:https://www.31ppt.com/p-2887972.html