• 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

A doubt in setVisible() in gui

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai,
I have a simple doubt...i created a GUI application in java, a complex one with NetBeans IDE..and is running perfectly without any problems...here i used the setVisible method a number of times for the components like JList, JLayeredPane etc...
can there be any problem in future in my application because of this setVisible method...if so is there any solution for that....
any help will be appreciated...thanks in adcance
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you suspect that there might be a problem with the setVisible() method, did somebody tell you that or did you read something somewhere? Please tell us more about why you think this might be a problem.
 
Nijin puthiya purayil
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesper de Jong wrote:Why do you suspect that there might be a problem with the setVisible() method, did somebody tell you that or did you read something somewhere? Please tell us more about why you think this might be a problem.



Yes one person told me that he had a problem in developing some gui application...but not in java..actually i was developing an application for him and when i was discussing with him then he told me like that
since i was a beginner and he is an experienced person i had that doubt...but again he does not know java but knows oop very well...this is just a doubt,, i'm not sure whether it is foolish to ask..if so pardon me..
thanks again
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no need to use setVisible() on a JList or JLayeredPane etc. Those components are always visible (assuming you add them to a window).

You only use setVisible() on JFrame, JDialog, etc.
 
Nijin puthiya purayil
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Camick wrote:There is no need to use setVisible() on a JList or JLayeredPane etc. Those components are always visible (assuming you add them to a window).

You only use setVisible() on JFrame, JDialog, etc.




Thanks for your reply.....here i know these components are always visible...but i made them invisible through some actionListeners like KeyTyped, KeyReleased etc using setVisible(false)...and made visible for some other actionListeners using setVisible(true)...
and again i'm telling you that my application is working perfectly without any problems....actually i meant to say whether this can make any problems in future in my application...
 
Rob Camick
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It shouldn't cause any problems, those a valid methods found in the API.
 
Greenhorn
Posts: 9
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's see. Some guy who doesn't know java had problems writing a GUI. He was writing it in a language other than Java. Because of this you're wondering if you should be worried about a Java application you wrote which appears to run just fine.

Stop thinking that this guy is raising valid issues.

Start believing you're a better developer than he is in spite of his experience.
 
Nijin puthiya purayil
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bill Krieg wrote:Let's see. Some guy who doesn't know java had problems writing a GUI. He was writing it in a language other than Java. Because of this you're wondering if you should be worried about a Java application you wrote which appears to run just fine.

Stop thinking that this guy is raising valid issues.

Start believing you're a better developer than he is in spite of his experience.



Thanks for your reply Bill Krieg and Rob Camick...
So now i believe i'm a better developer than him...
Thanks again
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic