• 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

Parsing a variable

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys and girls,
I've written a class which creates an instance of a second class, which in turn creates an instance of a third class i.e.

I need to wait for a button press in class c before returning the value of Variable back to class a.
Can anybody tell me how i can do this.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could do it by writing a constructor for class C which waits for the button to be pressed. But the design as a whole strikes me as a little bit strange. If you would get more concrete on what you want to accomplish, it would be much easier to propose an appropriate solution...
 
Peter Phung
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm writing an FTP application with a database connection to allow the user to choose which file they want to download.
ClassA is the main GUI which controls the application.
ClassB is a query mask which takes user input and parses that information to classC
ClassC diaplays the results of the query in a table, from which the user can a file to download.
this filename is needed by classA for it to be able to download the file.
I hope that this explains what i'm trying to accomplish
I would appreciate any suggestions for a different approach or any solutions to my current problem.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Peter Phung:
I'm writing an FTP application with a database connection to allow the user to choose which file they want to download.
ClassA is the main GUI which controls the application.
ClassB is a query mask which takes user input and parses that information to classC
ClassC diaplays the results of the query in a table, from which the user can a file to download.
this filename is needed by classA for it to be able to download the file.
I hope that this explains what i'm trying to accomplish
I would appreciate any suggestions for a different approach or any solutions to my current problem.


OK, what you seem to want to do is something like

This could be pseudocode for your ClassA, whereas UserInfoDialog would resemble ClassB and FtpFileChooser ClassC.
Does that help?
 
Peter Phung
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think i need to explain my appliaction a bit clearer. My application is more than 3 classes. i will explain each class below
class a :
allows the user to select a file for uploading onto the FTP server.
opens a dialog to collect connectiion details and passwords.
Opens the FTP client(class c).
opens the database query tool(class b)
this class only collects data.
class b:
this creates the query for the database. The user inputs the search criteria and the class generates a query for the database and parses the query to class c.
Class c:
this class queries the database and displays all of the results in a table. When the user double clicks on the file name/clicks OK the file name needs to be parsed back to class a. This is so class a has the name of the file which the user wants to download. Class a then calls class d.
class d:
This is the FTP client. Handles both uploading and downloading of files.
I hope that this has explained my problem a bit clearer.
Thanks for the suggestions so far
[ May 22, 2002: Message edited by: Peter Phung ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you want to use class B from class A to get data from class C?
 
Peter Phung
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've found a solution to my problem. Here's the code that i used:

[ May 23, 2002: Message edited by: Dirk Schreckmann ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you run across the Producer/Consumer example in Sun's Java Tutorial?
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic