• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling info

 
DANIEL GRESHAM
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try not to laugh too hard, but I am creating my first program that utilizes a second class the program will accept one value and return it to memory[]
heres the code

now for my question, how do i call this class to open when a method is activated and retrieve the data(val)?
heres what i think i need to do please tell me if I'm wrong


thanks in advance,
Danny
 
Layne Lund
Ranch Hand
Posts: 3061
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you are on the right track. The main thing your missing is that you need to display the dialog:

As you are learning Java, you should become familiar with the API documentation for the version you are using. These docs provide information about all the classes and methods that are available from the standard API. For example, if you look at the docs for JDialog, you will quickly see some links for a tutorial about how to use a dialog box. If you scroll further down, you will see the methods provided by the JDialog class. In this particular case, your MyDialog class inherits all of these methods, including show() which will display the dialog. I'll leave it to you to figure out how to hide the dialog when you are done with it.

Layne
 
DANIEL GRESHAM
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when calling the GetValue() method, this returns the variable val, now to use this in a new class, do i have to assign it to a new variable or just use val from teh MyDialog class?
 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does NOT return the variable val, it returns value of val.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic