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 / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

re-writing code to deal w/depr. stuff, probl decl. class..

Thread view: 
Frances Del Rio - 14 Jun 2005 18:50 GMT
I dl'd an applet (a jabber client)

and of course when I try to compile some of the source code I run into
deprecated stuff (what else is new..)

specif. in this case it deals w/AWT package..

window.show() has been deprecated, acc. to docs
(http://java.sun.com/j2se/1.5.0/docs/api/index.html) it's been replaced
with  Component.setVisible(boolean)

so I'm having a hard time no. 1 b/c I'm switching from a void method to
a bolean one..  I tried (after importing java.awt.Component)

 Component component = new Component(); // which of course didn't work
b/c Component is an abstract class and cannot be instantiated..
(so: 2nd problem..)

so tried this

public class comp extends Component {  //  and
private class comp extends Component {
   but they are both "illegal" expressions (why?)

so I did
   
       class comp extends Component {
      }
    comp.setVisible();

now I get this error:

IM.java:61: setVisible(boolean) in java.awt.Component
cannot be applied to ()
comp.setVisible();

      would appreciate any help here..  thank you very much..  Frances
Andrew Thompson - 14 Jun 2005 19:22 GMT
> now I get this error:
>
[quoted text clipped - 3 lines]
>
>        would appreciate any help here..  thank you very much..  Frances

Programming requires reading a lot of documentation (including
JavaDocs), interpreting information, asking questions when confused
and by clarifying, building a framework such that one might elicit
from one's own memory, the way forward to an IT solution.

Asking this question now, some ..9 months after we had a very
similar discussion* leads me to suspect you lack these skills.
Have you considered Frances, that despite your best efforts,
you may not be suited to computer programming?

*
<http://groups.google.com.au/group/comp.lang.java.help/msg/9d60bf6da1e4ff7f>

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane

Frances Del Rio - 14 Jun 2005 19:46 GMT
>>now I get this error:
>>
[quoted text clipped - 13 lines]
> Have you considered Frances, that despite your best efforts,
> you may not be suited to computer programming?

Andrew, I did read javadocs (you mean
http://java.sun.com/j2se/1.5.0/docs/api/index.html?)
this is where I found out what that depr. method was replaced with..
this is on code I didn't write myself, doesn't come with a javadocs (I
assume javadocs means "layout" of packages, classes, etc. as in url
above.. no, it doesn't come w/that..) at any rate depr. mehtod is b/c
guy did his stuff w/JVM 1.4 and I have 1.5..  I may need to switch back,
or need to find out if can have both 1.4 and 1.5 installed and choose
which one to compile stuff with...

you wanna know something funny? after that post in which you told me to
unzip rt.jar to see what was in it I did exaclty that, and don't know
how/what else I did, b/c after that my JVM didn't work anymore and I had
to re-isntall it....;)

I know a lot more about this now (about jar files, I know how to create
them, unzip them, etc.. view their contents in DOS shell, etc..)  I have
learned a lot in the last few months, and I'm getting good comments at
work about my progress..  I wrote my own little app in Tomcat the other
day w/cookies, putting info in db, etc.. and it's running pretty ok,
thank you very much.. (I wrote it myself from scratch..)  so... I will
try to forget what you said...
(and well, I somehow figure out answer to my q..)  what is a bit
frustrating to me is that, you know, I do read a lot, but sometimes when
try to aply what I read I run into problems..  pls don't try to
discourage people who are trying so hard to learn..

(funny, you did mention Frame.show() in that post, which coincidentally,
you mentioned just as an example, which I really didn't remember, I
hadn't asked about that and had never used it, which is why I
didn'remember..  (my question was about Window.show(), but well, I see
what you mean anyway...)

either way thank you for your response..  Frances

> *
> <http://groups.google.com.au/group/comp.lang.java.help/msg/9d60bf6da1e4ff7f>
Roland - 14 Jun 2005 21:17 GMT
>>now I get this error:
>>
[quoted text clipped - 13 lines]
> Have you considered Frances, that despite your best efforts,
> you may not be suited to computer programming?

I find this an incredibly arrogant response. It was *you*, not Frances,
who brought up the deprecated Frame.show() in the discussion you are
referring to. And I even wouldn't call it a discussion: you brought it
up as an *example* what could be found in the JavaDocs. The subject of
that thread was entirely different. It was about jars and how to obtain
their contents, so I don't think you can blame Frances for not
remembering it.

To me it seems that OP is /confused/ about the usage of setVisible()
[which, by the way, he did find as alternative for show() (maybe by
reading JavaDocs?)] and that he is /asking questions/ to /clarify/ his
understanding of it. So, what do you think OP is not doing what
constitutes programming?

Who do you think you are to write such a cocky response?

And what do you think to accomplish with it. Should OP say "Oh yes,
Andrew, you're sooo right, I think I give up programming immediately"?

I often get the feeling that you think you're sooo good. If you think
you are so good yourself, you may want to reconsider your problem
understanding and problem solving skills:
<http://groups-beta.google.com/group/comp.lang.java.programmer/msg/9f2c3c3a8504e8
6e?hl=en
>
<http://groups-beta.google.com/group/comp.lang.java.programmer/msg/f9555a77315c5e
0e?hl=en
>

> *
> <http://groups.google.com.au/group/comp.lang.java.help/msg/9d60bf6da1e4ff7f>
>
Signature

Regards,

Roland de Ruiter
` ___      ___
`/__/ w_/ /__/
/  \ /_/ /  \

Roland - 14 Jun 2005 21:47 GMT
> I dl'd an applet (a jabber client)
>
[quoted text clipped - 33 lines]
>
>       would appreciate any help here..  thank you very much..  Frances

If you are in the process of replacing all deprecate method calls, then
you can replace a call like
  someFrameOrWindow.show();
by
  someFrameOrWindow.setVisible(true);
and similarly
  someFrameOrWindow.hide();
by
  someFrameOrWindow.setVisible(false);

The classes Window, Frame, Dialog and their Swing counterparts JWindow,
JFrame and JDialog all are subclasses of Component and all inherit the
method setVisible(boolean) from it (and show() and hide() as well). So
there's no need to create a subclass of Component.
Signature

Regards,

Roland de Ruiter
` ___      ___
`/__/ w_/ /__/
/  \ /_/ /  \

Frances Del Rio - 15 Jun 2005 14:09 GMT
>> I dl'd an applet (a jabber client)
>>
[quoted text clipped - 42 lines]
> by
>   someFrameOrWindow.setVisible(false);

totally..  this worked indeed..  thank you so much...:)

Frances

> The classes Window, Frame, Dialog and their Swing counterparts JWindow,
> JFrame and JDialog all are subclasses of Component and all inherit the
> method setVisible(boolean) from it (and show() and hide() as well). So
> there's no need to create a subclass of Component.


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.