• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GroupLayout not working in a JPanel

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi JavaRanch

i've recently been playing around my project to try to get a nicer GUI on it, however i've hit a stumbelling point! He's the main class from my project.


i think the error comes from adding the JPanel component from another method, but eclipse doesn't see the error and it only appears when i run the compiler!
so my question is any idea why its doing this?

thanks in advance

sam
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What compiler are you using? Most importantly, the version. Perhaps your Eclipse is using Java 6 and your command line is still Java 1.4.

Never mind, I just tried compiling the class myself, and got these errors:
Where are these classes located?
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eclipse? That code looks more like something out of NetBeans
 
Samuel Woodhams
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Campbell your right it looks exactually like the code that netbeans's uses when you use the GUI tool! however i wrote the code manually - yes i know there are better layout managers but i like how the grouplayout one works ! Rob im compiling from inside Eclipse and i checked and it is using java 1.6 so i don't think its that! Big sorry however i should have pointed out that the main class wasn't compileable as it is - it uses some external classes - so here is a version that gives me the same error but only need the main class file to compile!



and just out of intrest i'll give you the errors the compiler is giving me!



i hope that this will help!

thanks in advance

sam
 
Samuel Woodhams
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry for the double post but does anyone have an idea on how to fix this?

thanks in advance

sam
 
Samuel Woodhams
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok i think people have dropped this thread, so if no-one replys i'll start a new topic!

i've found a workaround however im not sure why it would make it work, as far as i can work out it has the same effect as the version of the code above!

all i've done is moved the first JPanel to a static object and the whole code worked



please help me work this out!

thanks in advance

sam
 
reply
    Bookmark Topic Watch Topic
  • New Topic