• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog

 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would you go about creating the class named CustomDialog referred to within this code?

It needs a method that reads getValidatedText().




 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Line 1 of your snippet defines a class CustomDialog that inherits JDialog characteristics.
Line 3 of your snippet is an empty CustomDialog constructor.
Line 4 is a signature for a method within CustomDialog called getValidatedText()

One would instantiate your class CustomDialog with

CustomDialog customDialog = new CustomDialog();

I'm not sure what you're asking beyond those basics.
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you create any class? Somewhere you need code like:



That would probably be executed when you click on a button.

Instead of asking all these questions and not replying when you get answers its time you start posting a SSCCE with your question that shows what you've attempted.
 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excuse me, it turns out that I was missing one of the files, CustomDialog.java.
 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Camick wrote:How do you create any class? Somewhere you need code like:



That would probably be executed when you click on a button.

Instead of asking all these questions and not replying when you get answers its time you start posting a SSCCE with your question that shows what you've attempted.


There was a missing file, I didn't realize sorry, however I'm still getting compilation errors with both .java files in place:

C:\Documents and Settings\Jon\workspace\JavaDev\myCode Snippets\DialogDemo.java:64: cannot find symbol
symbol : class CustomDialog
location: class components.DialogDemo
CustomDialog customDialog;
^
C:\Documents and Settings\Jon\workspace\JavaDev\myCode Snippets\DialogDemo.java:70: cannot find symbol
symbol : class CustomDialog
location: class components.DialogDemo
customDialog = new CustomDialog(frame, "geisel", this);
 
Greg Brannon
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to provide more info. We can't guess why you're getting an error - other than for the obvious reasons stated in the error - without seeing the code causing the error.

I'm going to guess that you don't have a CustomDialog constructor that matches your instantiation of a CustomDialog, but that's a guess.
 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greg Brannon wrote:You need to provide more info. We can't guess why you're getting an error - other than for the obvious reasons stated in the error - without seeing the code causing the error.

I'm going to guess that you don't have a CustomDialog constructor that matches your instantiation of a CustomDialog, but that's a guess.


Nevermind, it seems to work when I launch the JNLP from their website, and, I'm not sure what is wrong with my copy and paste
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!