• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDialog

 
Ranch Hand
Posts: 664
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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().




 
Bartender
Posts: 563
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic