Re: Probs compiling - instanceOf statement and close brackets



PaulSchrum wrote:
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
      }
   }


Think you want to use 'instanceof' not 'instanceOf'.

--


Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________


'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)
.