• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

how to achieve a code using jdk doc?

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys i dont now how to use jdk docs from here could any one teach me? for example in JPanel see this code



how to achieve that code using jdk docs? step by step plss im trying this link http://download.oracle.com/javase/6/docs/api/javax/swing/JPanel.html but it never helps me.

i ask this question because jdk docs never helps me on writing java code may be some one who know how to use it and thanks in advance.
 
Sheriff
Posts: 28370
99
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you were expecting to be able to learn how to use a complex class like JPanel just by reading the API documentation, you are right, that is a very difficult thing to do. However if you start reading at the very beginning,

The API documentation wrote:For examples and task-oriented documentation for JPanel, see How to Use Panels, a section in The Java Tutorial.



So there's a link to a tutorial. Reading that tutorial is a much more practical way to learn. And you will find that most of the major Swing classes have an associated tutorial. I recommend reading them. And downloading their example code and fiddling around with it to see what you can do.
 
Jhovarie Guiang
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
looks like jdk docs is just a list of class, identifier, method, field etc.. and also explain what their function but it doest not help me to write java code. some times it helps me but from the code that i already know.

see this http://forums.oracle.com/forums/thread.jspa?messageID=9738467
 
Paul Clapham
Sheriff
Posts: 28370
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for posting the link to your cross-post, where it looks like a good discussion has taken place.

However I am astonished by your statement that you can't find a link to the tutorial, when I specifically told you right here exactly where to find that link.
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

This is a bad idea for any I/O code; you simply must handle exceptions, even if it's nothing more than print a message as to what happened someplace where you'll notice it.
 
Jhovarie Guiang
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:If you were expecting to be able to learn how to use a complex class like JPanel just by reading the API documentation, you are right, that is a very difficult thing to do. However if you start reading at the very beginning,

The API documentation wrote:For examples and task-oriented documentation for JPanel, see How to Use Panels, a section in The Java Tutorial.



So there's a link to a tutorial. Reading that tutorial is a much more practical way to learn. And you will find that most of the major Swing classes have an associated tutorial. I recommend reading them. And downloading their example code and fiddling around with it to see what you can do.




:jumpingjoy: yeh... from this link http://download.oracle.com/javase/6/docs/api/index.html?javax/swing/JPanel.html

there is a text saying that JPanel is a generic lightweight container. For examples and task-oriented documentation for JPanel, see How to Use Panels, a section in The Java Tutorial.

and it brings me to this link http://download.oracle.com/javase/tutorial/uiswing/components/panel.html

now i know how to use jdk docs and i love it now. :thumbup:
 
Jhovarie Guiang
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:
This is a bad idea for any I/O code; you simply must handle exceptions, even if it's nothing more than print a message as to what happened someplace where you'll notice it.



so what is the good idea about that?
 
Marshal
Posts: 80267
430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jhovarie Guiang wrote: . . . so what is the good idea about that?

Ulf has already told you what the right thing to do is.
 
Jhovarie Guiang
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Jhovarie Guiang wrote: . . . so what is the good idea about that?

Ulf has already told you what the right thing to do is.



i mean that give me the good sample code about that.
 
Paul Clapham
Sheriff
Posts: 28370
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:you simply must handle exceptions, even if it's nothing more than print a message as to what happened someplace where you'll notice it.



Are you seriously asking for sample code for "print a message"?
 
Jhovarie Guiang
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ah... i understand what Ulf is saying

like what i did in my try catch i must add ex.printStackTrace() or System.out.println(ex);



i just miss understand the post of Ulf a while ago.
 
Sheriff
Posts: 22821
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Printing the stack trace is preferred over simply printing the exception, because the stack trace also tells you where the exception occurred, not only what exception occurred.
 
Skool. Stay in. Smartness. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic