• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

passine event from one form to other gui form

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if( yes == can we pass or call an event of one form from another form) {
can you give me an examole to call a button_click event of the one gui form from another form;
}
else {
any other logic to same;
}





i am just a beginner.............please help me out
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

It sounds like you might be talking about JavaScript rather than Java. Can you give us more details about exactly what you want to do?
 
Sun Il Kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes



like........We have a buttton ButttonMain in parent form and ButtonChild in child form. I want to call the event ButtonChild_click of ButtonChild from ButtonMain of main form In java not in java script


can it is possible..........if yes then give me an example...........if not can we perform this functionality from any other way to call a form event from other form in java




SKM
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a few ways you could manage this.

1. If you can make the JButton (I assume you're using JButtons) on one form available to the other form you can call the doClick() method of that button to simulate it being clicked.

2. You could add the same ActionListener to both buttons.

3. You could define a method on one of the forms, and have the actionPerformed method of the two ActionListeners call it.

So the first approach makes one button fake a button click on the other, and the other two make the two buttons have the same effect. Either way, one of the forms will need a reference to the other. Here's a simplified example (using option 1):

 
Sun Il Kumar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks sir, Matthew Browns
I was making a project .............and need this functionality .......thanks so much sir.
 
I am going to test your electrical conductivity with this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic