aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Save Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Save Button" Watch "Save Button" New topic
Author

Save Button

Vito Ganci
Greenhorn

Joined: Sep 29, 2013
Posts: 4
Good Morning, I had build a Main Form with a MenuBar, in this MainForm I had put a layeredpane where I show a JInternalFrame.
In my MenuBar I had put a JButton (Save); I would like that when I click on button Save I can retrieve the data from the JInternalFrame showing.
How I can do?
m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 155
Good Morning,

for all your posts, everywhere ---> for better help sooner post an SSCCE, short, runnable, compilable, just about a.m. issue
Vito Ganci
Greenhorn

Joined: Sep 29, 2013
Posts: 4
Do you have understand my problem? Can you help me?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Welcome to the Ranch.
Usually one would put a JMenuItem on the JMenuBar (unless of course you are using a JToolBar) and listen to the menu selection to trigger off the required action.
More on building and using menus here http://docs.oracle.com/javase/tutorial/uiswing/components/menu.html


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Vito Ganci
Greenhorn

Joined: Sep 29, 2013
Posts: 4
I had write wrong, In the my menu I have a menu item, but the problem is how to retrieve data from the active internal frame when click on menu itmem?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Impossible to say without seeing your code. Post your SSCCE (<-link; click to find out what it means) so we can take a look
Vito Ganci
Greenhorn

Joined: Sep 29, 2013
Posts: 4
my main class where there is the menu


here I open a JInternalFrame



The Internal Frame have many JtextField ie JTextField1, JTextField2 that the user fill

now from my memù item I would like to retrive this values:
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

The code you posted is useless for us. We cannot download compile or run it on our machines.
Did you take a look at the SSCCE link like I requested? Here it is one more time. http://sscce.org/
Please post a proper SSCCE
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39396
    
  28
I am afraid, I think you are going around this the wrong way entirely. What you have done is create a button and ask that button to save. What you need to do is work out how to sve something without the button. Create an object which encapsulates all the data from the internal frame, and save that, using the command line only.
When you have a class with a public save() method, you can call it from the buttonNote there is a special condition: if myModel is a local variable or parameter, it will probably have to be marked final.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Save Button