JProgressBar and events

Hi,
I would like my JProgressBar to respond to focusLost and focusGained is it possible in a simple way to achive this, or do I have to dig into the source?
thanx
marcus

Read the tutorial: [http://java.sun.com/docs/books/tutorial/essential/concurrency/guardmeth.html]
When a thread invokes d.wait, it must own the intrinsic lock for d � otherwise an error is thrown.
Put the th.wait() call inside a synchronized block
synchronized (th) {
     th.wait();
}Also you can call Thread.start() only once on the same object, so you will have to create a new instance of the thread if you want it to start again.

Similar Messages

  • JProgressBar and ObserverPattern in multiple document app??

    Hi,
    I'm working on a multiple document application with jInternalFrames. There is one very time-consuming process and therefore I'd like to show a progressbar for the user to know, that the programm is still running.
    So Icreated a seperate internalFrame with a jProgressBar and I implemented the observer pattern.
    Now the problem is: my time-consuming process (which is in the observable-class) notifies the internalFrame whenever one percent of work is done,
    and the programm even enters the update method of the internal frame. In this update method i set the value of the
    progress bar, but nothing happens. I tried a repaint() and even a paintImmediately() but nothing happens until
    my time-consuming process is done. That's not exactly what i call a progressbar... ;-) It is even worse as the whole view of the application is faulty once I minimized and then resized the main window while my time-consuming process is running.
    So I already found some articles and I fear I have to work with threads. But how?
    can anyone explain to me what method I have to run as a thread and how can I refresh my internalFrame respectively the progressbar then?
    I hope anyone can help me...

    * Progress_Test.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Progress_Test extends JFrame {
        public Progress_Test() {
            initComponents();
        private void initComponents() {
            desktop = new JDesktopPane();
            internalFrame = new JInternalFrame();
            panel = new JPanel();
            progressBar = new JProgressBar();
            progressBar.setVisible(false);
            toolbar = new JToolBar();
            startBtn = new JButton();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setTitle("Test Progress");
            internalFrame.setPreferredSize(new Dimension(200, 100));
            internalFrame.setVisible(true);
            panel.add(progressBar);
            internalFrame.getContentPane().add(panel, BorderLayout.CENTER);
            startBtn.setText("Start");
            startBtn.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    startBtnActionPerformed(evt);
            toolbar.add(startBtn);
            internalFrame.getContentPane().add(toolbar, BorderLayout.NORTH);
            internalFrame.setBounds(0, 0, 200, 100);
            desktop.add(internalFrame, JLayeredPane.DEFAULT_LAYER);
            getContentPane().add(desktop, BorderLayout.CENTER);
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-400)/2, (screenSize.height-300)/2, 400, 300);
        private void startBtnActionPerformed(ActionEvent evt) {
            if( ltThread == null || !ltThread.isAlive() ){
                progressBar.setValue(0);
                LongTask lt = new LongTask();
                ltThread = new Thread(lt);
                ltThread.start();
        public static void main(String args[]) {
            new Progress_Test().setVisible(true);
        private JDesktopPane desktop;
        private JInternalFrame internalFrame;
        private JPanel panel;
        private JProgressBar progressBar;
        private JButton startBtn;
        private JToolBar toolbar;
        private Thread ltThread;
        public class LongTask implements Runnable{
            public LongTask() {
                progressBar.setMaximum(max);
            public void run(){
                progressBar.setVisible(true);
                int n=0;
                while ( n<max ){
                    n++;
                    progressBar.setValue(n);
                    try{Thread.sleep(1000);}catch(Exception ex){}
                progressBar.setVisible(false);
            private int max=10;
    }

  • JProgressBar and thread

    hai,
    Actually i want to write a claa containg one JProgressBar and two jbuttons one button is used to start thread and it is updating progress bar value for every 500 milli seconds. one button is used pause the current running thread. again if i press start button the thread will start..
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ProgressDemo extends JFrame implements ActionListener,Runnable{
    Thread th;
    JProgressBar pro;
    int i=0;
    boolean flag=true;
    public ProgressDemo() {
    super("Test progress");
    pro=new JProgressBar(0,100);
    th=new Thread(this);
    JButton b1=new JButton("start");
    b1.addActionListener(this);
    JButton b2=new JButton("pause");
    b2.addActionListener(this);
    Container c=getContentPane();
    setLayout(new FlowLayout());
    c.add(b1);
    c.add(b2);
    c.add(pro);
    pack();
    setVisible(true);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    public static void main(String[] args) {
    ProgressDemo p=new ProgressDemo();
    public void actionPerformed(ActionEvent ae) {
    String s=ae.getActionCommand();
    if(s=="start"){
    System.out.println(s);
    if(flag)
    th.start();
    else
    flag=true;
    notifyAll();
    if(s=="pause")
    System.out.println(s);
    try {
    flag=false;
    th.wait();
    } catch (InterruptedException e) {
    e.printStackTrace();
    public void run(){
    System.out.println("running");
    for(i=0; i<=100; i++){
    if(flag)   
    pro.setValue(i);
    try {
    Thread.sleep(50);
    catch (InterruptedException e) {
    e.printStackTrace();
    }when press pause button i am getting runtime errors like this
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalMonitorStateException: current thread not owner
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Unknown Source)
    at ProgressDemo.actionPerformed(ProgressDemo.java:53)
    plz give comments where i went wrong...

    Read the tutorial: [http://java.sun.com/docs/books/tutorial/essential/concurrency/guardmeth.html]
    When a thread invokes d.wait, it must own the intrinsic lock for d � otherwise an error is thrown.
    Put the th.wait() call inside a synchronized block
    synchronized (th) {
         th.wait();
    }Also you can call Thread.start() only once on the same object, so you will have to create a new instance of the thread if you want it to start again.

  • Business Event Brochure in Training and Event Management?

    Hi Guru's
    My client has a requirement as follows. The training administrator decides the Business Event Types which for which superiors can book their subordinates or not. Those events are stored at a particular place. Once the administrator stores them, a mail should be triggered to all the superiors. Thus superior can have a list of event types for which he can book his subordinates. When he books for such events, a mail should be triggered to his subordinates regarding the training event. If an employee books for an event, a mail should be triggered to his superior for approval.
    How is this possible? According to me, those events will be "Included in Brochure" (in Business Event Type Infotype). Am I right?
    Please suggest me.
    Points assured!
    Thanks in advance.

    Hello ,
    see the links it might help :
    Business processes of Training and Event Managment
    Training and Event Management
    Lots of workflow

  • TEM and FI/CO   (Training and Event Management)

    Hi All,
    I wish to track actual cost per event in PE (TEM - Training and Event Management).  Was considering having a Internal order per Instance of event. Have any Idea on how to set up something like this?
    Appreciate all ideas,
    LB

    Hi Dean,
    using internal orders you have to consider that sending and receiving cost center have to in the same company code.
    If you do not want to distribute the costs to FI/CO but only report them, you can use the cost items provided by TEM. We have set up something similar for our plants in South Europe.
    We have created some cost items and fill them manually with the training costs. Additionally we have created a report that evaluated this costs and combines them with the employee costs (derived from salary).
    Best regards
    Michael

  • How to incorporate training and event management module in ess1.0

    Hi all,
    I am implementing ess1.0 on EP6.0, NW7.0, ecc6.0.
    now in ess1.0 i could not find traing and event manag. module, but i found it in ITS version of ess.
    how can i incorporate 'traing and event manag' module in ess1.0??
    do i need to download two version of ess?...i doubt if its feasible!...can anybody guide me on this?
    I am new to portal, and hence trying to learn thing in EP ESS...please throw in your help ASAP
    Regards,
    JJ

    hi all,
    can anybody please throw some light on the above query?
    i m trying to search in forum but i am unable to find any reasonable answer to this.
    Regards,
    JJ

  • Course Catalog in Training and Event  Management

    Hi TEM Gurus,
    My client wants that users can see only courses of training and event management business catalog in ESS, they can't book or do any activities related to TEM. How we can put restriction for that requirement. We are using ITS services PV7I and PV8I.
    Could you please update me as early as posisble ?
    Thanks and Best Regards
    Puneet

    Hi Dear,
    Thanks a lot for quick reply. Could you please give me details inofmration .. How to do changes in the system..
    How to disable book and cancel functionality from the portal.
    Thanks and Best Regards

  • PMS and Training and Event Management

    Hi Gurus,
    Our one the of the client implementing PMS and Training and Event Management.
    Could anyone suggest me what are the questions need to be asked in initial meeting with the client.
    and if anyone has configuration documents on PMS and Training and Event management please forward to me,
    my id would be [email protected]
    Regards,
    Rajesh Soma 

    The prerequisites of PMS is OM and PA is mandatory,
    PMS is just like an interaction between the manager and the employees in an enterprise, based
    On his work they are going to put some rating etc.
      In the standard system employee called as “Appraise” Manager called as an “Appraiser” and Manager’s Manager called as Higher level manager “Part Appraiser “ can be a self-peer & customer they can save & provide their Comments to  the “Appraiser”
    First you take the requirement form client side what are the process and how Appraisal system in client then you have to prepare one sheet like Preparation ,Planning,Process
    for business functions and other check below :-
    HCM, Performance Management (Flexible) 01 - SAP Documentation
    HCM, Performance Management (Predefined) 03 - SAP Documentation
    check below once :-
    Tcodes for PMS Basic Setting
    OOHAP_BASIC      Basic Appraisal Template Settings
    OOHAP_CATEGORY      Appraisal Category Settings
    OOHAP_CAT_GROUP Category Group Settings
    OOHAP_SETTINGS_PA PA: Settings
    OOHAP_VALUE_TYPE Standard Value Lists
    T codes for PMS Process
    PHAP_ADMIN     Administrator - Appraisal Document
    PHAP_CATALOG     Appraisal Template Catalog
    PHAP_CHANGE     Change Appraisal Document
    PHAP_CREATE     Create Appraisal
    PHAP_PREPARE     Prepare Appraisal Documents
    PHAP_SEARCH     Evaluate Appraisal Document
    start your work with above things any other post here again ......

  • Appraisals & training and event management problem

    Hi gurus.
    I'm trying to configured the integration between Appraisal and Training & Event management (Appraising a Business Event and Attendee Appraisal
    I set an attribute HAP00 REPLA = A .
    But two problems occurred.
    1.
    The definition of Appraisal catalog for employees is no problem. But I have a problem with definition of Appraisal catalog for Business event and for Attendees.
    Through the definition of Appraisal catalog via SPRO (Training and Event Management/Recurring Activities/Appraisals/Edit Appraisals Catalog) its possible to create an appraisal templates only for employees (it looks like that, because there is only Category group Personnel Appraisals and it’s not possible to add new category for example Attendee Appraisal).
    Can somebody help me where I can define appraisal templates for Event management or how can I get the Appraisal catalog category groups - Appraising a Business Event and Attendee Appraisal?
    2.
    I set the attributes SEMIN EVAEV/EVAPA to the values 2/3 in connection with table T77BF.
    When I run tcode PV33 or PV34 the matchcode of appraisal templates contains the list of all object type VA. The problem is that when I run tcode PV33 I don’t want to see all appraisal templates, but only for appraising a Business Event.
    It is possible to configure that so? If yes, how.
    Thanks in advance.
    Regards

    Hi,
    1. transaction LSO_CATALOG
    Regards and Groetjes,
    Maurice Hagen

  • Regarding training and event management queries

    hi experts,
    in my company we have ess in which training and event management module is working fine.i need to develop a report in which training booked against employee through tc-psv1 means in sap-r/3 and through ess means tc-pv8i will come.means saggregation for sap r/3 and ess will come.
    please help me regarding this.
    how will i identifie that training has been booked against employees  through sap r/3 or ess on what paramenet we will identifie.
    plz help me....
    is there any function module;....

    solved by own

  • Need Report in Training and Event Management

    Dear All,
    I want a report in Training and Event Management consisting of attendee name and training date and venue details, price for training event and would like to know any standard report available.
    Kindly let me know the std report name.
    Thanks and Regards
    Suresh,V

    Hi!
    for all reports try T-code : SAP1 ( Report Selection ) & SAP2 ( Info catalog ) here you will get all the standard reports available for that module .
    Regards
    Sheetal
    Edited by: sheetal Gulati on May 14, 2009 7:51 AM

  • Extraction and loading of Training and Event Management data (0HR_PE_1)

    hello,
    I've got the following doubt:
    before BI 7.0 release, extractor 0HR_PE_1 extracts event data (eventid, attendee id, calday,...) but if you load straight to cube 0PE_C01, as Calendar year/month needs a reference date (for example, event start date), you'll get total duration of event in hours or days refered to event star date.
    So in a query filtered by month, you get total duration of an event that starts in the filtered month but it couldn`t end until few months later o year later, so you don´t get appropiate information.
    Example:
    Event          calday        Hours
    10004377  20081120   500        but from event_attr event end date is 20090410.
    In a query filtered by 200811 you get total duration time (500 hours when in 200811 event hours have been 20) or if you filter by any month of 2009 you don´t get information of duration of that event.
    I had to create a copy of standar cube (without calday, only Calendar year/month, Calendar year in time dimension) and disaggrate data creating as many entries for an event as months lasts and adjust calculation of ratios duration of event (duration of event in each month/ total duration of event).
    The question is: Is there any improvement or change on business content in BI 7.0 to treat Training and Event Management data? Has anybody had to deal with that?
    Thank you very much.
    IRB

    Hi,
    TEM data is stored in HRP tables.
    You can load the catalog by creating LSMWs for objects Business event group (L), Business event types (D), Locations (F), Organizers (U) as per requirement.
    LSMW for tcode PP01 can be used to create these objects.
    To create Business Events (E) you can create LSMW for PV10/PV11.
    To book attendee create LSMW for tcode PV08 as here you can specify the actual business event ID which reduces ambiguity.
    tcode PV12 to firmly book events
    tcode PV15 to follow up
    Hope this helps.
    Regards,
    Shreyasi.

  • Email on Training and Event Management

    Dear all,
    I would like to know are there any email supported in Training and Event Management Module.
    For example, after HR administrator help book courses for staff, system will trigger an email notification to staff mailbox with certain course detail information
    Regards
    Bill

    Hi Bill,
    In your case the event for triggering the email notifications will be when the booking is done. So before booking, for the object like Business event type and/or business event group some relationship exits. Once you do a booking of course, additional relationship will be created in different objects. Not exactly sure about the relationship code, but you can easily find out from hrp1001.
    So yoor program will check for this partcular relationship, and if it exists then will send mail notifications.
    Thanks!
    Regards,
    Chetan Shriraj Wahane

  • Training Need - TN in Training and Event Management

    Hi
    Did any one worked on Training Need (TN) in Training and event management? I have the below question.
    For France there is a legal requirement to capture some 1.6 % of the employee annual gross salary towards training cost.  So where to record the training cost of the employee in Training and event management and is there any link with payroll. 
    Logically it sounds as it does.  but where and how is it connected with payroll.
    Please revert if you know the solution.
    Brs
    Kenu.

    Hi
    In Table V_T77TNM_DC
    We need to have the below entries
    TNM                                              CL_HRTNM_VALO_COMPUT_GUI_FR
    TNM       HRTNM00_REPMOD        CL_HRTNM_VALO_COMPUT_GUI_FR
    TNM       MP168400                       CL_HRBAS_INFTY_1684_GUI_FR
    TNM       RPCTNM9S_REP            CL_HRTNM_INFTY_1036_GUI_FR
    Regards
    Kenu

  • Training and Event Management

    Can anyone guide me as how to create Training Events in bulk through SAP? I am getting stuck in all ways.. I am not sure where exactly FIRMLY BOOKED flag is stored coz of which we are not able to develop any programs.. Please guide me if ther is any way available to create Courses in bulk..

    Firmly Booked flag is stored in Infotype 1026. If you want to create courses (E) in bulk, use planning Menu (PSVP in Training and Event Management and LSO_PSVP in LSO)
    Close the thread if your problem is solved.

Maybe you are looking for