wangting
2024-11-27 3b3fd904b9b34e77445d749bca8c28beadcaf3db
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
 
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();
    }
    
}