【Java开源代码栏目提醒】:本文主要为网学会员提供VindicateNoteDialog.java,希望对需要VindicateNoteDialog.java网友有所帮助,学习一下!
/*
* CreateDialog.java
*
* Created on 2008年8月18日, 下午7:39
*/
package com.mwq.frame;
import com.mwq.dao.Dao;
import com.mwq.tool.AwakeThread;
import com.mwq.tool.ScreenSize;
import java.util.Vector;
/**
*
* @author GaoFei
*/
public class VindicateNoteDialog extends javax.swing.JDialog {
private static final Dao dao = Dao.getInstance();
private String type;
private Vector updateRow;
/** Creates new form CreateDialog */
public VindicateNoteDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
ScreenSize.centered(this);
}
@Override
public void setVisible(boolean b) {
if (updateRow == null) {
setTitle("添加" + type);
timeField.fillWithSystemTime();
} else {
setTitle("修改" + updateRow.get(1));
calendarComboBox.getTextField().setText(updateRow.get(2).toString());
timeField.setTime(updateRow.get(3).toString());
titleTextField.setText(updateRow.get(4).toString());
contentTextArea.setText(updateRow.get(6).toString());
if (updateRow.get(5).toString().equals("1")) {
yesRadioButton.setSelected(true);
}
}
super.setVisible(b);
}
/** 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() {
awokeButtonGroup = new javax.swing.ButtonGroup();
dateLabel = new javax.swing.JLabel();
calendarComboBox = new com.mwq.calendar.CalendarComboBox();
timeLabel = new javax.swing.JLabel();
timeField = new com.mwq.mwing.TimeField();
titleLabel = new javax.swing.JLabel();
titleTextField = new javax.swing.JTextField();
contentLabel = new javax.swing.JLabel();
contentScrollPane = new javax.swing.JScrollPane();
contentTextArea = new javax.swing.JTextArea();
awokePanel = new javax.swing.JPanel();
yesRadioButton = new javax.swing.JRadioButton();
noRadioButton = new javax.swing.JRadioButton();
submitButton = new javax.swing.JButton();
exitButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
dateLabel.setText("日期:");
timeLabel.setText("时间:");
titleLabel.setText("主题:");
titleTextField.setColumns(40);
titleTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
titleTextFieldKeyTyped(evt);
}
});
contentLabel.setText("内容:");
contentTextArea.setColumns(40);
contentTextArea.setRows(5);
contentTextArea.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
contentTextAreaKeyTyped(evt);
}
});
contentScrollPane.setViewportView(contentTextArea);
awokePanel.setBorder(javax.swing.BorderFactory.createTitledBorder("提醒"));
awokeButtonGroup.add(yesRadioButton);
yesRadioButton.setText("是");
awokeButtonGroup.add(noRadioButton);
noRadioButton.setSelected(true);
noRadioButton.setText("否");
javax.swing.GroupLayout awokePanelLayout = new javax.swing.GroupLayout(awokePanel);
awokePanel.setLayout(awokePanelLayout);
awokePanelLayout.setHorizontalGroup(
awokePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(awokePanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(yesRadioButton)
.addGap(18, 18, 18)
.addComponent(noRadioButton)
.addContainerGap(172, Short.MAX_VALUE))
);
awokePanelLayout.setVerticalGroup(
awokePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(awokePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(awokePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(yesRadioButton)
.addComponent(noRadioButton))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
submitButton.setText("确定");
submitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
submitButtonActionPerformed(evt);
}
});
exitButton.setText("退出");
exitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exitButtonActionPerformed(evt);
}
});
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.TRAILING)
.addComponent(awokePanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(dateLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(calendarComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(titleLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(titleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(contentLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(contentScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(timeLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(timeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.
上一篇:
VImage.java
下一篇:
关于大学英语教学