Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

how to hide a jList

Thread view: 
Mariano - 11 Apr 2007 14:01 GMT
I need to hide a jList, i've used

jList_name.setVisible(false);

but this don't work properly, and seems only to disable jList use. How
can I HIDE the jList???

Thanks.
Andrew Thompson - 11 Apr 2007 14:11 GMT
>I need to hide a jList, ..
...
>can I HIDE ..

There is no call for SHOUTING.

> ..the jList???

Nor for using more than one '?' character.

OK - to your question (or mine, at least).
How is the GUI supposed to appear once the
JList is hidden?

One strategy is to remove it from the GUI and
call  pack(), but note that is generally not a good
strategy.

The other strategies I can think of, would leave a
'space' on the GUI where the JList was, is that
what you are after?  A CardLayout (with one card
blank, and the other card containing the JList)
is one way to achieve that - simply flip between
the two cards as needed.

HTH

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Andrew Thompson - 11 Apr 2007 14:13 GMT
>I need to hide a jList, i've used

And note that class is a JList (unless you are referring
to some custom class of which I have no knowledge).
Please take care with class (method and attribute)
name capitalisation.

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Mariano - 11 Apr 2007 15:18 GMT
> >I need to hide a jList, i've used
>
[quoted text clipped - 7 lines]
>
> Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200704/1

for capitalisation this time only a lack of memory, anyway cardLayout
seems really hard solution, I obtain a series of runtime error that
can't explain...
Andrew Thompson - 11 Apr 2007 15:30 GMT
>> >I need to hide a jList, i've used
...
>for capitalisation this time only a lack of memory,

What, you could not remember by the end of the
sentence that 'for' was all lower case?  (Each
sentence should start with a capital letter as well).

>..anyway cardLayout..

That is CardLayout you are referring to?

>...seems really hard solution,

Maybe programming is not the thing for you.

>..I obtain a series of runtime error that
>can't explain...

No I was wrong.  *Definitely* programming is
not the thing for you.  If you cannot effectively
communicate the problem, all is lost.

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Mariano - 11 Apr 2007 15:42 GMT
> >> >I need to hide a jList, i've used
> ..
[quoted text clipped - 23 lines]
>
> Message posted viahttp://www.javakb.com

hahaha :D
sure i don't love programming, moreover this is my first experience
with OOP. I've to use java for Oracle exam to university, i've studied
Oracle and DB, not Java.

Anyway, I've resolved problem in a more simple way, all element in
JPanel and use setVisible method directly on JPanel, a sort of
CardLayout.
Brandon McCombs - 12 Apr 2007 00:31 GMT
>>>>> I need to hide a jList, i've used
>> ..
[quoted text clipped - 28 lines]
> JPanel and use setVisible method directly on JPanel, a sort of
> CardLayout.

You'll have to excuse Andrew since "helping" people without sarcasm or
condescension is not the thing for him.
Lew - 12 Apr 2007 02:08 GMT
Mariano wrote:
>> Anyway, I've resolved problem in a more simple way, all element in
>> JPanel and use setVisible method directly on JPanel, a sort of
>> CardLayout.

JPanel is not "a sort of CardLayout".  I think I don't understand what you
mean here.

Signature

Lew

Brandon McCombs - 12 Apr 2007 00:28 GMT
>> I need to hide a jList, i've used
>
> And note that class is a JList (unless you are referring
> to some custom class of which I have no knowledge).
> Please take care with class (method and attribute)
> name capitalisation.

Live on the edge for once and make an assumption that he is most likely
talking about the same JList that you ended up mentioning in your post.
You obviously knew what he was referring to so unless their class name
is so far off of an existing class that you can't figure it out, assume
the class a poster names is the one with the equivalent name in the Java
API. If that assumption proves wrong then it is the poster's fault for
not taking the time to make the distinction that their, for example,
jlist is not the same as the javax.swing.JList class.
Lew - 12 Apr 2007 02:11 GMT
>>> I need to hide a jList, i've used
>>
[quoted text clipped - 10 lines]
> not taking the time to make the distinction that their, for example,
> jlist is not the same as the javax.swing.JList class.

It doesn't help the OP much to let them slide on capitalization issues if they
want to be a successful programmer.

If people want to resolve their programming difficulties, step one is to
define their problem precisely.  Saying 'jList' for 'JList' is sloppy and
detrimental to problem resolution.

That is said without derision, condescension or sarcasm.  If you can't even
spell the name of the class right, you're doomed.  So you might as well get in
the habit of spelling it right.

Which is Andrew's point, which helps the OP, and if Andrew had not addressed
the point he'd've been remiss in his efforts to assist.

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.