📄 singlelistemailpanel.java
字号:
package za.co.halo.SecureCommunications.gui.client2;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.WindowConstants;
import javax.swing.JFrame;
import javax.swing.JLabel;
import za.co.halo.SecureCommunications.Email;
/**
* This code was generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* *************************************
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED
* for this machine, so Jigloo or this code cannot be used legally
* for any corporate or commercial purpose.
* *************************************
*/
public class SingleListEmailPanel extends javax.swing.JPanel {
private JLabel subject;
private JLabel sender;
private JLabel time;
private Email email;
private boolean isSelected;
/**
* Auto-generated main method to display this
* JPanel inside a new JFrame.
*/
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.getContentPane().add(new SingleListEmailPanel(null,false));
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}
public SingleListEmailPanel(Email e, boolean isSelected) {
this.email = e;
this.isSelected = isSelected;
initGUI();
}
private void initGUI() {
try {
//this.setForeground(Color.white);
this.setPreferredSize(new java.awt.Dimension(329, 51));
if (isSelected) this.setBackground(new Color(15,65,108));
else this.setBackground(new Color(21,118,146));
this.setLayout(null);
{
sender = new JLabel();
sender.setForeground(Color.white);
this.add(sender);
sender.setText(email.getSender());
sender.setBounds(5, 5, 200, 16);
}
{
subject = new JLabel();
subject.setForeground(new Color(152,162,165));
this.add(subject);
subject.setText(email.getSubject());
subject.setBounds(5, 25, 143, 16);
}
{
time = new JLabel();
time.setForeground(new Color(152,162,165));
this.add(time);
time.setText(email.getTime());
time.setBounds(100, 5, 220, 16);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -