This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

FileDialog Events

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any way to track down the internal events generated in a FileDialog ?
Thanks
Kavya
[This message has been edited by kavya krushi (edited February 02, 2001).]
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure that I understand the question. Are you asking how to "listen" to the user response?
Or are you asking what is really involved in generating a FileDialog?
 
kavya krushi
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi Cindy,
Yes i need to listen to the events generated with in the FileDialog ...
That is for example if the Update button is clicked i need to record this event(say i have to print a stmt that Update button has been clicked)
Similarly i need to track the evens that are generated when a filter is changed or a new folder is selected ...
I tried different ways but all i got is the current information stored in the FileDialog with methods like getFile() ...
Any help will be gladly appreciated ...
kavya
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that you would need to put a listener on each of the things that you want to respond to.
For buttons you would probably use an ActionListener.
For Filters (say typed in a TextField) you would need a button of some sort to know that they are done inputting the filter.
For Selecting things from l list you would probably need an item listener.
etc. Here is a sample of an ItemListener.


import java.awt.*;
import java.applet.*;
import java.awt.event.*;
APPLET code = "ChoiceDemonstration.class" width=300 height=200>
APPLET>
public class ChoiceDemonstration extends Applet implements ItemListener{
private Choice c;
String state = "";
public void init() {
c= new Choice();
c.addItem("First");
c.addItem("Second");
c.addItem("Third");
c.addItemListener(this);
this.add(c);
}
public void itemStateChanged(ItemEvent ie ) {
state ="deselected";
if(ie.getStateChange()== ItemEvent.SELECTED){
state = "Selected";
// do other good stuff
repaint();
}
}
public void paint(Graphics g)
{
String mesg = "choice demo :";
mesg += c.getSelectedItem();
state = mesg + state;
g.drawString(state,40,40);
}
}


Here are some good references. http://www.javasoft.com/products/jdk/1.1/docs/guide/awt/designspec/events.html http://java.sun.com/docs/books/tutorial/uiswing/overview/event.html
 
kavya krushi
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks Cindy, I will look over the links ...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic