41 |
|
_label = new JLabel(name + ": "); |
42 |
|
_label.setHorizontalAlignment(JLabel.RIGHT); |
43 |
|
setLayout(new GridLayout(1, 2)); |
44 |
+ |
_item.addItem("-uninitialised-"); |
45 |
|
add(_label); |
46 |
|
add(_item); |
47 |
|
} |
55 |
|
* run this method. |
56 |
|
*/ |
57 |
|
public void run() { |
58 |
< |
_item.removeAllItems(); |
59 |
< |
StringTokenizer st = new StringTokenizer(_cache); |
60 |
< |
while(st.hasMoreTokens()) { |
61 |
< |
_item.addItem(st.nextToken()); |
58 |
> |
_item.removeAllItems(); |
59 |
> |
if (_cache.equals(" ")) { |
60 |
> |
_item.addItem("no users logged on"); |
61 |
> |
} else { |
62 |
> |
StringTokenizer st = new StringTokenizer(_cache); |
63 |
> |
while(st.hasMoreTokens()) { |
64 |
> |
_item.addItem(st.nextToken()); |
65 |
> |
} |
66 |
|
} |
67 |
|
} |
68 |
|
|
98 |
|
} catch (Exception e) { |
99 |
|
throw new DataFormatException(value + " is an invalid data type for " + toString()); |
100 |
|
} |
101 |
< |
} |
101 |
> |
} |
102 |
> |
|
103 |
> |
/** |
104 |
> |
* Returns the string showing the packet |
105 |
> |
* attribute that the component is looking after |
106 |
> |
* |
107 |
> |
* @return the packet reference |
108 |
> |
*/ |
109 |
> |
public String getPacketAttribute() { |
110 |
> |
return _attribute; |
111 |
> |
} |
112 |
|
|
113 |
|
//---ATTRIBUTES--- |
114 |
|
|