Exemplo n.º 1
0
  @Override
  public Object onRetainNonConfigurationInstance() {
    final Stu stu = new Stu();
    stu.name = "wo2";
    stu.no = 100;
    Log.d(TAG, "onRetainNonConfigurationInstance");

    return stu;
  }
Exemplo n.º 2
0
  /** Create the frame. */
  public FindStuFrame() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 450, 337);
    contentPane = new JPanel();
    contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(contentPane);
    contentPane.setLayout(null);

    JPanel panel = new JPanel();
    panel.setBounds(0, 0, 434, 299);
    contentPane.add(panel);
    panel.setLayout(null);

    JLabel messageLabel = new JLabel("学生表信息:");
    messageLabel.setFont(new Font("微软雅黑", Font.PLAIN, 15));
    messageLabel.setBounds(144, 44, 127, 25);
    panel.add(messageLabel);

    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setBounds(41, 86, 356, 152);
    panel.add(scrollPane);

    table = new JTable(model);
    scrollPane.setViewportView(table);
    List list = deleteGrade.executeStu();
    for (int i = 0; i < list.size(); i++) {
      Stu stu = (Stu) list.get(i);
      model.addRow(new Object[] {stu.getId(), stu.getName(), stu.getSex(), stu.getSpecialty()});
    }
    JButton watchButton = new JButton("查看成绩表");
    watchButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            do_deleteButton_actionPerformed(arg0);
          }
        });
    watchButton.setBounds(98, 255, 101, 23);
    panel.add(watchButton);

    JButton closeButton = new JButton("关闭");
    closeButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            do_button_1_actionPerformed(arg0);
          }
        });
    closeButton.setBounds(255, 255, 85, 23);
    panel.add(closeButton);
  }
Exemplo n.º 3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Log.d(TAG, "onCreate func called!");

    if (null != savedInstanceState) {
      Log.d(TAG, "onCreate, savedInstanceState" + savedInstanceState.getString("name"));
    }

    final Stu stu = (Stu) getLastNonConfigurationInstance();
    if (null != stu) {
      Log.d(TAG, "onCreate,getLastNonConfigurationInstance," + stu.toString());
    }
  }