how to hide a jList

M

Mariano

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.
 
A

Andrew Thompson

Mariano said:
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

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

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-general/200704/1
 
M

Mariano

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.

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...
 
A

Andrew Thompson

Mariano said:
...
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.
 
M

Mariano

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).


That is CardLayout you are referring to?


Maybe programming is not the thing for you.


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

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.
 
B

Brandon McCombs

Andrew said:
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.
 
B

Brandon McCombs

Mariano said:
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.

You'll have to excuse Andrew since "helping" people without sarcasm or
condescension is not the thing for him.
 
L

Lew

Brandon said:
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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top