Probs compiling - instanceOf statement and close brackets
- From: "PaulSchrum" <paul.schrum@xxxxxxxxx>
- Date: 30 Dec 2005 14:34:52 -0800
I am a swing newbie and kind of inexperienced in java. I am using
NetBeans (I don't think that comes in to play, though).
I am implementing my own layout manager, and I am getting compile
errors in which I do not understand what it wants me to do differently.
In my code listing I have put the compile error messages in comments
on the line in which they happen. Can someone help me understand what
the compiler wants?
Thanks for your help
- Paul Schrum
public void layoutContainer(Container target) {
synchronized(target.getTreeLock()) {
Dimension dim;
Insets insets = target.getInsets();
int maxwidth = target.getWidth() - (insets.left +
insets.right);
int nmembers = target.getComponentCount();
int x = 0, y = insets.top;
int rowh = 0, start = 0;
for (int i = 0 ; i < nmembers ; i++) {
Component m = target.getComponent(i);
if(m instanceOf JFrame) { // '/' expected
layoutContainer(m);
dim = m.getSize();
}
else if(m instanceOf(JTextField)) {
i = i + 0;
}
} // illegal start of expression
}
}
.
- Follow-Ups:
- Re: Probs compiling - instanceOf statement and close brackets
- From: Mark Thomas
- Re: Probs compiling - instanceOf statement and close brackets
- From: IchBin
- Re: Probs compiling - instanceOf statement and close brackets
- Prev by Date: Creating a file in a directory
- Next by Date: Re: Probs compiling - instanceOf statement and close brackets
- Previous by thread: Creating a file in a directory
- Next by thread: Re: Probs compiling - instanceOf statement and close brackets
- Index(es):
Relevant Pages
|
|