Java Code Examples for javax.swing.JLabel.getMinimumSize()

The following are Jave code examples for showing how to use getMinimumSize() of the javax.swing.JLabel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Equella   File: UserSelectorControlEditor.java   View Source Code Vote up 6 votes
public UserGroupPanel(String text, String groupText, String restrictGroupText)
{
	super(text, false);

	groupLabel = new JLabel(groupText);
	groupList = new FilteredShuffleList<NameValue>(restrictGroupText, new FilterGroupModel(getClientService()
		.getService(RemoteUserService.class)));

	final int height1 = groupLabel.getMinimumSize().height;
	final int height2 = groupList.getMinimumSize().height;
	final int[] rows = {height1, height2};
	final int[] cols = {TableLayout.FILL};

	setInnerLayout(new TableLayout(rows, cols, 5, 5));
	addInner(groupLabel, new Rectangle(0, 0, 1, 1));
	addInner(groupList, new Rectangle(0, 1, 1, 1));

	setSelected(false);
}
 
Example 2
Project: Equella   File: DRMAccessControlTab.java   View Source Code Vote up 6 votes
public NetworkPanel()
{
	super(CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.restrictip"), //$NON-NLS-1$
		false);

	titleLabel = new JLabel(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.ipbased")); //$NON-NLS-1$
	selectable = new JCheckBox(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.selectable")); //$NON-NLS-1$
	networks = new NetworkShuffleList();

	final int height1 = titleLabel.getMinimumSize().height;
	final int height2 = networks.getMinimumSize().height;
	final int height3 = selectable.getPreferredSize().height;
	final int[] rows = {height1, height2, height3};
	final int[] cols = {TableLayout.FILL};

	setInnerLayout(new TableLayout(rows, cols, 5, 5));
	addInner(titleLabel, new Rectangle(0, 0, 1, 1));
	addInner(networks, new Rectangle(0, 1, 1, 1));
	addInner(selectable, new Rectangle(0, 2, 1, 1));

	setSelected(false);
}
 
Example 3
Project: Equella   File: DRMAccessControlTab.java   View Source Code Vote up 5 votes
public UserGroupPanel(RemoteUserService userService)
{
	super(CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.restrict"), //$NON-NLS-1$
		false);

	userLabel = new JLabel(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.users")); //$NON-NLS-1$
	groupLabel = new JLabel(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.groups")); //$NON-NLS-1$

	userList = new FilteredShuffleList<NameValue>(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.restrictusers"), //$NON-NLS-1$
		new FilterUserModel(userService));
	groupList = new FilteredShuffleList<NameValue>(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.restrictgroups"), //$NON-NLS-1$
		new FilterGroupModel(userService));

	selectable = new JCheckBox(
		CurrentLocale.get("com.dytech.edge.admin.wizard.editor.drm.drmacccesscontroltab.selectable")); //$NON-NLS-1$

	final int height1 = userLabel.getMinimumSize().height;
	final int height2 = userList.getMinimumSize().height;
	final int height3 = selectable.getPreferredSize().height;
	final int[] rows = {height1, height2, height1, height2, height3};
	final int[] cols = {TableLayout.FILL};

	setInnerLayout(new TableLayout(rows, cols, 5, 5));
	addInner(userLabel, new Rectangle(0, 0, 1, 1));
	addInner(userList, new Rectangle(0, 1, 1, 1));
	addInner(groupLabel, new Rectangle(0, 2, 1, 1));
	addInner(groupList, new Rectangle(0, 3, 1, 1));
	addInner(selectable, new Rectangle(0, 4, 1, 1));

	setSelected(false);
}