freelanceprogrammers.org Forum Index » Java
IllegalArgumentException problem
Joined: 11 Apr 2004
Posts: 12
IllegalArgumentException problem
Note: my mail server is messed up, sorry if you get this twice.
I subclassed a Jlabel in the class below. When it reaches
this.setVerticalAlignment(MailLabel.LEFT), it throws an
IllegalArgumentException even though this constant is allowed in
Jlabel. It seems I`m only allowed to have a 0 or 1 for the Argument,
while .LEFT = 3. Any ideas of what could be wrong?
import java.awt.*;
import javax.swing.JLabel;
public class MailLabel extends JLabel
{
public MailLabel(int x, int y, int width, int height, String
strLabel, MailTextBox txtBox)
{
this.setBounds(new Rectangle(x,y,width,height));
this.setBackground(Color.white);
this.setForeground(Color.blue);
this.setFont(new Font("Dialog", 1, 12));
this.setDisplayedMnemonic(0);
this.setVerticalAlignment(MailLabel.LEFT);
this.setText(strLabel);
this.setLabelFor(txtBox);
}//end first constructor
public MailLabel(String strCaption)
{
super(strCaption);
this.setVerticalAlignment(1);
}//MailLabel constructor
}//end MailLabel class
Joined: 11 Apr 2004
Posts: 11
IllegalArgumentException problem
Don Roberts wrote:
> Note: my mail server is messed up, sorry if you get this twice.
>
> I subclassed a Jlabel in the class below. When it reaches
> this.setVerticalAlignment(MailLabel.LEFT), it throws an
> IllegalArgumentException even though this constant is allowed in
> Jlabel. It seems I`m only allowed to have a 0 or 1 for the Argument,
> while .LEFT = 3. Any ideas of what could be wrong?
LEFT is not a valid VERTICAL alignment. LEFT is a HORIZONTAL
alignment. VERTICAL alignment needs to be TOP, CENTER or BOTTOM.
--
Dale Erwin
Salamanca 116
Pueblo Libre
Lima 21 PERU
Tel. +51(1)461-3084
Cel. +51(1)9743-6439
DALE ERWIN`S OPERA FILES - http://www.geocities.com/dale_erwin
Joined: 11 Apr 2004
Posts: 12
IllegalArgumentException problem
You are correct, of course, thanks Dale.
Don - somewhat new to Java
----
Don Roberts
http://tv.groups.yahoo.com/group/seinfeldpreservationsociety/
http://groups.yahoo.com/group/windows-tips/
Please reply to the list and not to me personally.
**-----Original Message-----
**From: Dale Erwin [mailto:daleerwin@...]
**Sent: Thursday, April 15, 2004 7:13 PM
**To: beginnersclub@yahoogroups.com
**Subject: Re: [Java Beginner`s club] IllegalArgumentException problem
**
**Don Roberts wrote:
**> Note: my mail server is messed up, sorry if you get this twice.
**>
**> I subclassed a Jlabel in the class below. When it reaches
**> this.setVerticalAlignment(MailLabel.LEFT), it throws an
**> IllegalArgumentException even though this constant is allowed in
**> Jlabel. It seems I`m only allowed to have a 0 or 1 for the
**Argument,
**> while .LEFT = 3. Any ideas of what could be wrong?
**
**LEFT is not a valid VERTICAL alignment. LEFT is a HORIZONTAL
**alignment. VERTICAL alignment needs to be TOP, CENTER or BOTTOM.
**--
**Dale Erwin
**Salamanca 116
**Pueblo Libre
**Lima 21 PERU
**Tel. +51(1)461-3084
**Cel. +51(1)9743-6439
**DALE ERWIN`S OPERA FILES - http://www.geocities.com/dale_erwin
**
**
**
**
**Yahoo! Groups Links
**
**
**
**
**
**
**
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







