|
package com.vci.client.framework.systemConfig.log;
|
|
import java.awt.BorderLayout;
|
import java.awt.Dimension;
|
import java.awt.Rectangle;
|
import java.awt.event.ActionEvent;
|
|
import javax.swing.JPanel;
|
import javax.swing.JScrollPane;
|
|
import com.vci.client.LogonApplication;
|
import com.vci.client.logon.base.BaseJDialog;
|
import com.vci.client.ui.image.bundle.BundleImage;
|
import com.vci.client.ui.swing.VCISwingUtil;
|
import com.vci.client.ui.swing.components.VCIJButton;
|
import com.vci.client.ui.swing.components.VCIJLabel;
|
import com.vci.client.ui.swing.components.VCIJPanel;
|
import com.vci.client.ui.swing.components.VCIJTextArea;
|
|
public class DetailDialog extends BaseJDialog{
|
|
private static final long serialVersionUID = 1L;
|
private String content;
|
|
VCIJTextArea descriptionArea = new VCIJTextArea();
|
// private KJButton cancelButton = new KJButton(LocaleDisplay.getI18nString("rmip.framework.button.cancel", "RMIPFramework", getLocale()) , "cancel.gif");
|
private VCIJButton cancelButton = new VCIJButton("关闭", VCISwingUtil.createImageIcon("cancel.gif"));
|
public DetailDialog(String content){
|
super(LogonApplication.frame, true);
|
this.content = content;
|
init();
|
}
|
public void init (){
|
VCIJLabel titleLabel = new VCIJLabel();
|
titleLabel.setText("日志详细描述信息");
|
setTitle(titleLabel.getText());
|
titleLabel.setIcon(new BundleImage().createImageIcon ("star.png"));
|
|
JPanel bottomPanel = new JPanel();
|
bottomPanel.add(cancelButton);
|
|
JPanel contentPanel = initCenterContentPanel();
|
|
JPanel midPanel = new JPanel();
|
midPanel.setLayout(new BorderLayout());
|
midPanel.add(contentPanel, BorderLayout.CENTER);
|
|
this.setLayout(new BorderLayout());
|
this.add(titleLabel, BorderLayout.NORTH);
|
this.add(midPanel, BorderLayout.CENTER);
|
this.add(bottomPanel, BorderLayout.SOUTH);
|
|
// int x = (int)(this.getParent().getLocationOnScreen().getX()) +500;
|
// int y = (int)(this.getParent().getLocationOnScreen().getY()) +200;
|
// this.setLocation(x , y);
|
// this.setSize(500, 500);
|
initDialogSize(400, 400);
|
this.setVisible(true);
|
}
|
private JPanel initCenterContentPanel() {
|
VCIJPanel contentPanel = new VCIJPanel();
|
contentPanel.setLayout(new BorderLayout());
|
JScrollPane jsDescription=new JScrollPane();
|
contentPanel.add(jsDescription);
|
descriptionArea.setLineWrap(true);
|
descriptionArea.setBorder(null);
|
jsDescription.getViewport().add(descriptionArea);
|
cancelButton.addActionListener(new java.awt.event.ActionListener() {
|
public void actionPerformed(ActionEvent e) {
|
cancelButton_ActionPerformed(e);
|
}
|
});
|
initContent();
|
return contentPanel;
|
}
|
private void initContent(){
|
descriptionArea.setText(content);
|
}
|
/**
|
* 取消按钮事件
|
* @param e
|
*/
|
private void cancelButton_ActionPerformed(ActionEvent e) {
|
this.dispose();
|
}
|
|
}
|