📄 singelaccountclass.java
字号:
package za.co.halo.SecureCommunications.gui.server;
import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.WindowConstants;
import javax.swing.JFrame;
import za.co.halo.SecureCommunications.ServerAccount;
/**
* @author
* class SingleAccountClass
* This class presents a Panel to add the accountName of the
* account to a list which are displayed when viewing the accounts
*/
/**
* 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 SingelAccountClass extends javax.swing.JPanel {
private JLabel accountName;
private ServerAccount account;
private boolean isSelected;
/**
* main method
* Use 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);
}
/**
* SingleAccountClass constructor
* Use to:
* initialize member variables
* initialize the build of graphical components.
* @param ServerAccount(account), boolean(isSelected): to initialize the member functions
* @return void
*/
public SingelAccountClass(ServerAccount account, boolean isSelected ) {
this.account = account;
this.isSelected = isSelected;
initGUI();
}
/**
* initGUI method
* Use to:
* build the graphics
* @param void
* @return void
*/
private void initGUI() {
try {
this.setPreferredSize(new java.awt.Dimension(300, 54));
if (isSelected) this.setBackground(new Color(15,65,108));
else this.setBackground(new Color(21,118,146));
this.setLayout(null);
{
accountName = new JLabel();
accountName.setForeground(Color.white);
this.add(accountName);
accountName.setText(account.getUserName());
accountName.setBounds(7, 16, 153, 16);
}
/* {
subject = new JLabel();
subject.setForeground(new Color(152,162,165));
this.add(subject);
subject.setText(account.getMailboxSize());
subject.setBounds(180, 16, 97, 16);
}*/
} catch (Exception e) {
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -