File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "JDialog" Watch "JDialog" New topic
Author

JDialog

Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 659

How would you go about creating the class named CustomDialog referred to within this code?

It needs a method that reads getValidatedText().





Jon
Greg Brannon
Bartender

Joined: Oct 24, 2010
Posts: 530
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.


Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1808
    
    2
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

Joined: Apr 25, 2008
Posts: 659

Excuse me, it turns out that I was missing one of the files, CustomDialog.java.
Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 659

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

Joined: Oct 24, 2010
Posts: 530
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

Joined: Apr 25, 2008
Posts: 659

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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: JDialog
 
Similar Threads
JOptionPane Timeout
how to use getParent() ?
Escape sequences
Parent/Child Window Communication
JDialog components not refreshing