- package bbs.istak.org.tw;
- import java.awt.BorderLayout;
- import java.awt.EventQueue;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.border.EmptyBorder;
- import javax.swing.JLabel;
- import javax.swing.JTextPane;
- public class Main extends JFrame {
- private JPanel contentPane;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- Main frame = new Main();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the frame.
- */
- public Main() {
- setTitle("\u6642\u9418");
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 315, 130);
- contentPane = new JPanel();
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- contentPane.setLayout(null);
-
- JLabel label = new JLabel("\u73FE\u5728\u6642\u9593\uFF1A");
- label.setBounds(14, 13, 83, 19);
- contentPane.add(label);
-
- Date date = new Date();
- SimpleDateFormat nd24 = new SimpleDateFormat("西元yyyy年 MM月 dd日 , hh時 mm分 ss秒");
-
- JLabel lblNewLabel = new JLabel(nd24.format(date));
- lblNewLabel.setLabelFor(lblNewLabel);
- lblNewLabel.setBounds(24, 45, 259, 25);
- contentPane.add(lblNewLabel);
-
-
- }
- }
複製代碼 |