📄 singlegroupclass.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.ServerGroup;
/**
* @author
* SingleGroupClass
* This class presents a Panel to add the groupName of the group to a list which are displayed when viewing the groups
*/
/**
* 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 SingleGroupClass extends javax.swing.JPanel {
private JLabel groupName;
private ServerGroup group;
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);
}
/**
* SingleGroupClass constructor
* Use to:
* initialize member variables
* initialize the build of graphical components.
* @param ServerGroup(group), boolean(isSelected): to initialize the member functions
* @return void
*/
public SingleGroupClass(ServerGroup group, boolean isSelected ) {
this.group = group;
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);
{
groupName = new JLabel();
groupName.setForeground(Color.white);
this.add(groupName);
groupName.setText(group.getGroupName());
groupName.setBounds(7, 16, 153, 16);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -