How to trigger window minimize event manully

in my program i've two jframes, i want to hide one frame when clicking a button in another frame.
I achieved it thro frame.setVisible(false) but i want native minimize transition and than hide.It's just like when a user clicks the button other frame must minimize and than hide.
so i need to trigger the minimize event thro program, how can i do that

Juz execute this code armi, it works fine... tell me after that... the previously attached code was wrong... use this...
import java.awt.BorderLayout;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Class7 extends JFrame implements ActionListener
  private JPanel jPanel1 = new JPanel();
  private JButton jButton1 = new JButton();
  public Class7()
    try
      jbInit();
    catch(Exception e)
      e.printStackTrace();
  public static void main(String[] ar)
    Class7 c = new Class7();
  private void jbInit() throws Exception
    jPanel1.setLayout(null);
    jButton1.setBounds(new Rectangle(115, 215, 175, 35));
    jButton1.setText("jButton1");
    jButton1.addActionListener(this);
    jPanel1.add(jButton1,null);
    this.getContentPane().add(jPanel1, BorderLayout.CENTER);
    this.setSize(400,400);
    this.setVisible(true);
  public void actionPerformed(ActionEvent ae)
  if(ae.getSource() == jButton1)
    this.setExtendedState(this.ICONIFIED);
}Hope this helps u...
Regards,
Ciya

Similar Messages

  • How to trigger Alert with Event Linkage?

    Hi,
    Can any one tell me the process how to trigger alerts with event linkage? I am successul in triggering by calling function module SALRT_CREATE_API.
    my scenario is...
    when a purchase order is cancelled, i have to trigger an alert to the concerned department head throgh Alert Inbox and external mail also.
    Plese guide me..
    Regards,
    Dhanunjaya Reddy

    Hi,
    now i am getting alerts from Event Linkage.
    Here i take the scenario Sales order change.
    BOR object : BUS2032
    Event          : Changed
    Receiver type : <my alert>
    Receiver call  : Function Module
    Receiver Functiona Module : SALRT_CREATE_VIA_EVENT
    Linkage is activated.
    when a sales order is changed receiver function module triggering the alert which is defined in Receiver type. That i am getting in my alert inbox. Upto this.. it is cleared.
    Now the scenario is.. about Alert Container
    in alert container i take element is BOR Object type BUS2032.
    the questions are..
    1. Is it correct to defined BOR object here to get data when Sales order has been changed.
    2. What are the properties i have to take in Properties tab?
    3. How to use alert container parameters in short and long text?
    Here my clear intention is when a sales order is changed.. i have to get the data related to that sales order and it has to show in Alert.

  • How to detect window close event and do some task before exiting

    Hi 
    Anyone knows how to detect window close event and do some task before exiting ?
    Sridhar
    Solved!
    Go to Solution.
    Attachments:
    window close event.JPG ‏34 KB

    Yes .You can discard the panel close event by passing "TRUE" boolean value to the "discard ?" terminal which is lied in the right side of that panel close(filter) event.& It will work in executables.  See attached picture.
    Attachments:
    Panel Close.JPG ‏12 KB

  • How to trigger Business Transaction Event "WEIGH" in WM?

    How to trigger the Business Transaction Event "WEIGH" in WM from a user program?
    This "WEIGH" Business Transaction Event is supposed to modify the status in "status Management System" of SAP.
    Appreciate some feedback.

    Hi Ashutosh, if you are trying to raise a custom event you first must define the event within your business object, using TC SWO1.  If you like you can extend an existing business object or create a new one.  Once your business object is activated and your event is released you should be able to trigger it with the FM 'SWE_EVENT_CREATE'.
    P.S  If you are extending an existing business object, for example BUS2105 and your extended name is ZMBUS2105, refer to the original name, i.e. BUS2105 for the objtype field in the call to 'SWE_EVENT_CREATE'.
    Hope that helps,
    Kevin

  • How to define custom event and how to trigger the defined event

    hi,guys
    hurry issue....................hope get help.
    I am using oracle weblogic 10gr3 portal.and we choiced java portlet.as of now,we got some question about custom Event.hope you can give some idea....
    thank you so much.
    question detail:
    1.for java portlet ,how to define custom event.
    2.how to trigger this event.
    3 about the data,may be sometime need to transit Biz data.
    auctully,I just want to implements between two portlets communicate.
    for example:
    existing portletA,portletB.
    portletA is a list,like:
    A AA <button>
    after I click this buttom,then portletB will be effect,it means they are interact with each other.
    does anybody hit this issue before,if you solved pls share me .
    thank you for you help....

    Hello,
    Please note that everything below applies to JSR168 portlets ONLY- JSR286 portlets and other portlet types handle events a little differently.
    From inside your JSR168 portlet you can send an event during processAction or when receiving another event by using the PortletBackingContext object, such as:
    import javax.portlet.ActionResponse;
    import javax.portlet.ActionRequest;
    import javax.servlet.http.HttpServletRequest;
    import com.bea.netuix.servlets.controls.portlet.backing.PortletBackingContext;
    public void processAction(ActionRequest actionRequest, ActionResponse actionResponse)
    HttpServletRequest httpRequest = (HttpServletRequest) actionRequest.getAttribute("javax.servlet.request");
    PortletBackingContext portletBackingContext = PortletBackingContext.getPortletBackingContext(httpRequest);
    portletBackingContext.fireCustomEvent("customEvent", "This is a custom event");
    To receive an event, in your .portlet file you just need to put in a "handleCustomEvent" tag specifying which method to call when the event is received, such as:
    <?xml version="1.0" encoding="UTF-8"?>
    <portal:root xmlns:netuix="http://www.bea.com/servers/netuix/xsd/controls/netuix/1.0.0"
    xmlns:portal="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/servers/netuix/xsd/portal/support/1.0.0 portal-support-1_0_0.xsd">
    <netuix:javaPortlet title="Listening Portlet" definitionLabel="yourPortletName">
    <netuix:handleCustomEvent event="customEvent" eventLabel="customEvent" filterable="true" description="custom event handler">
    <netuix:invokeJavaPortletMethod method="processCustomEvent"/>
    </netuix:handleCustomEvent>
    </netuix:javaPortlet>
    </portal:root>
    Then, in your receiving portlet the method "processCustomEvent" would receive the event, such as:
    public void processCustomEvent(ActionRequest actionRequest, ActionResponse actionResponse, Event event)
    The event payload can be any Serializable object you want, but for forward-compatibility with JSR286 it would be ideal if it had a valid JAXB binding.
    Kevin

  • How to trigger the "click" event using javascript in LC8?

    I have 2 button in the form. I don't want the user to click the button1 directly (invisible now). but I want the user click the button2 and then do some checking. after checking is finisined,  the script will continue to trigger the button1 "click" event. How to trigger the button1 "click" event through javascript in LC 8? Thanks.

    button2.execevent("click");

  • How to trigger the valuechange event on button

    Hi All,
    I am working on ADF Application and i have a requirement where i have a valuechange event function associated with the textbox andthe requirement is like the user will enter the value in text box and he/she will press the submit button directly without tab out .I want to trigger my value change event first and if all validation goes right then it should trigger the button event but user will press the butto only once.
    Please reply !!!
    Urgent !!
    Thanks..

    public int validate(){
    int result=0;
    if (value == null){
    //do something
    result=1;
    return result;
    on button click call this
    public String commandButton1_action() {
    if(validate()!=0){
    return null;
    //do rest...
    }

  • How to trigger Process after Event

    Hi,
    I am trying to trigger a PC after an Event. This event is another PC variant. I know this will be Event= RSPROCESS but, How to get the value for Parameter.
    Thanks in Advance

    For Process Chain Adhoc scheduling
    1)You can make the process chain to be trigered by an event.
    You do so by having the Job that start the PC start after an Event.
    Then you define your set of job's (tcode:  SM37) and make sure these jobs fire the event that starts the PC.
    There is an ABAP program you can use that fires events (FM -> BP_EVENT_RAISE).
    try this in your ABAPcode:
    CALL FUNCTION 'BP_EVENT_RAISE'
    EXPORTING
    eventid = 'Your Event'
    eventparm = 'START'
    target_instance = ' '
    EXCEPTIONS
    OTHERS = 01.
    schedule ur process chain,
    2)In the Start process of your process chain, select Direct Scheduling and then click the Change Selections icon. This will bring you to the Start Time window where you can put in the Date/Time you want to start your process chain. At the bottom of this window, click on the Periodic job box and you will notice another icon way at the bottom called Period Values. Click this to determine what frequency the job should be rescheduled (ie. daily, weekly, etc.).
    3) u can do this by an alternate way--> click  start process, --> selection "Maintain Variant", choose "Direct Scheduling". Next select "Change Selections", pick your date and time, set your period values , and activate it.

  • How to  trigger specific DB event on msg content basis- DTD is same,

    Hi,
    Scenario is like this:
    I will receive PO from diff. customers(set up in Oracle B2B) , all sending in same DTD format(3A4 PIP), all msg will routed to iStudio via IP_IN_QUEUE (queue mngt provided by Oracle B2B), being published by AQ adapter & subs. by dbadapter.
    I have to trigger diffrent events on the basis of few fields (DUNS num).. the dtd for all the events is same? How can I do this?
    All the events are created in different business objects itself... plz suggest whether this approah is right or not .. -:(.
    Actually ecah event had few hardcodings which caused to create seperate events/BO for the TPs, but if the msg is coming from same queue how can I route it to diff events?
    What is the use of Event Map tab present in define App view of AQ Adapater? Will this be helpful in some way?
    Any pointers will be a great help.
    Regards,.
    MSri

    I find the OAIHeader very useful to try to ascertain from what adapter the inbound message was sourced from.
    Include the OAIHeader in your Common View, and pass the SenderName / SendingApplication / BusinessObject / EventName / through to your Subscribe Application View.
    At runtime, the OAIHeader section of the Common View will get filled in, and when mapped to an attribute(s) on your Subscribe code, you may be able to trigger your inbound message handling based on this / these fields contents.
    HTH
    Yan

  • How to trigger the exit event of a subform?

    hi there,
    we added some code to the exit event of a subform to do some validation, but we found out that
    if the user save the form after filling it and without clicking somewhere outside the subform,
    the exit event will not be trigger, so the code will not check ,then the form got saved with errors.
    could you pls tell us how to solve this?
    br.
    zj

    Hi,
    Instead of writin code in Subform just write the code in exit of the individual field.
    thanks,
    Amish.

  • How to Trigger  Object type Event programmatically  in ABAP ?

    Experts,
    How to Generate an Object Type Event  programmatically in ABAP ???  We know that SAP std. applications do this by default ,for eg:  Sales Order creation event generation,  similarly , i want to generate an Event  ( SAP or a Z object event ) in my Z program ,, How can i do it ???  Do we have any function module for this one ?  I can do an BDC  CALL TRANSACTION SWUE but i don't want to do that,  i want to use some other method other than BDC.
    Would appreciate your reply . Thanks
    Ashutosh

    Hi Ashutosh, if you are trying to raise a custom event you first must define the event within your business object, using TC SWO1.  If you like you can extend an existing business object or create a new one.  Once your business object is activated and your event is released you should be able to trigger it with the FM 'SWE_EVENT_CREATE'.
    P.S  If you are extending an existing business object, for example BUS2105 and your extended name is ZMBUS2105, refer to the original name, i.e. BUS2105 for the objtype field in the call to 'SWE_EVENT_CREATE'.
    Hope that helps,
    Kevin

  • HOW TO TRIGGER CHECK BOX EVENT IN BLOCKED LIST OUT PUT

    Hi Abapers,
    I am developing ALV Blocked list using 3 internal tables.
    in output list my requirement is if I click one check box in one intrrnal table the below internal table checkboxes should be checked.
    how to solve this problem this is very urgent to me I hope somebody will help me.
    Regards
    Shashikumar.G

    Hi
    First you need to register the events of clicking of the checkbox.
    Once registerred, you can capture that event and when occured, you can set the checkboxes for below internal table.
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/95/34eb7feb6211d3a7270000e83dd863/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/95/34eb7feb6211d3a7270000e83dd863/frameset.htm</a>
    Regards
    Raj

  • How to trigger single click event in ALV

    Hi Experts,
          I am trying to raise an event in a module pool program whereby an event will be triggered on  a single click of a particular row in the ALV.
       My requirement is that in the table display , which is being handled OO method, once the user clicks on a particular row - the details of the row should be displayed in another part of the screen.
       I have used hotspots and done this - but I do not want all my entries underlined.

    Hi Atish,
    Is there any other way to trigger the single click event in the ALV grid display for a particular row ? I have come across an event CLICK_ROW_COL, which I think may solve the problem, however this is a protected event and whenever I try to access it , I get the error that a protected event cannot be accessed.
    Edited by: Aditya  Niyogi on May 14, 2008 6:33 AM

  • How to catch window maximised event ?

    I know I need to creat class that will implement WindowListener. But what even should I catch ?? And also... I need to restrict this function... so my window can't be maximised... how do i do this ? Any hints ??? Please help.

    For the first problem you should use the componentResized() method of the ComponentListener interface: in this method, just call yourFrame.getExtendedState() and compare it with JFrame.MAXIMIZED_BOTH... that will tell you if the frame has been maximized.
    For the second point, use the same principle: after the above test, if the frame is maximized you can resize it to whatever dimension you like.
    The code would be:
          yourFrame.addComponentListener(new ComponentAdapter() {
             public void componentResized(ComponentEvent e) {
                if (yourFrame.getExtendedState == JFrame.MAXIMIZED_BOTH) {
                   yourFrame.setSize(300,300);
          });Of course, the given size is for example.
    Hope this helped,
    Regards.

  • How to trigger standard FPM events through coding.

    While a standard FPM event triggers, it carries out with some event parameters which are automatically filled and is taken care by standard program.
    I have a requirement to raise a standard event manually, but in this case, the standard event parameters are not filled.
    Can any one tell me if there is any way through which I can get the event parameters automatically by raising a standard fpm event manually.

    Hi Chittibabu,
    There is no any such method to fill the event parameters automatically while we raise standard fpm event manually. You have to fill the parameters accordingly before you raise fpm event manually.
    Regards,
    Ravikiran.K

Maybe you are looking for

  • Implemanting Material ledger

    Regarding material ledger  Dear FI guys, I have a issue on material ledger. We are going for a upgrade from 4.6 C to ECC 6.0 that time client asking us to go with material ledger implementation also is there any impact with this up on upgrade and can

  • How to determine the users Browser (IE or WML)

    is there a way to programatically determine what the users browser is? I have a webdynpro that can run on both Blackberry (WML browser) and IE via the portal. I need a way to identify the users browser from Webdynpro Java.

  • HT4628 hi has anyone else considered going back to pen and paper after upgrading their imac to lion? i miss the internet connection that i pay for

    In our house we have lots of Apple products and they all conect to our wireless no problems.  My imac used to until I upgraded to lion and now it is almost useless.  I have updated software and tested my wireless connectivity which is fine with other

  • Initilization for 2lis_11_vahdr

    Hi Experts, I'm extracting data from 2lis_11_vaitm and 2lis_11_vahdr datasources. As I've huge data in production system. I want data from January 2009 to till data. I can able to get month wise sales orders. 1. I'm extracting data by giving the sele

  • Contact sheet with Photoshop CS5 Windows 7

    Hello As I tried to make some contact sheets with Photoshop CS5, I found that this functions disappeared from the "Automatization" menu (I had it in Photoshop CS3) How could I do ? Is there some special "plugin" to do that ? I use a french version of