Event dispatching in lightweight component

Hi all
I'm trying to figure out how the event dispatch works for the Swing's lightweight component, and there's something I can't find in the tutorials I found.
Lightweight components doesn't have a peer, so they don't receive directly paint events, but it's their containers that call it inside their paint() method (and that's why one should always write super.paint() if wants to override the container's paint() ).
But what about the other events? I suppose they are received by the container (just as paint events) but I can't understand how that container dispatches them to the right lightweight container...
Thank you

This is what I know about the painting in light weight component in Java.
Lets us concentrate on the button only.
Whenever we press the button we change it s state from 'normal' to 'pressed'. ( Some boolean might be used in the actual code ).
Like wise whenever we do some user inputs to the button ( or any other lightweight component ) it results in the change in the state of the button.
These basic actions are handled by BasicButtonListener.
Now whenever the state of a component is changed it triggers a ChangeEvent associated with that perticular state change.
The implementation of the button is such that it calls the repaint method itself whenever any state of the button changes.
So it is the component itselt who calls its paint method and not its outermost container as you think.
The container of any component can result in repainting of its child component only when it revalidates itself.

Similar Messages

  • Event Dispatch Thread Hangs, what is wrong?

    The Event Dispatch Thread Hangs when showing a modal dialog while running a
    SwingWorker Thread.
    I have included my code at the bottom of the page. There are three classes. I have posted a bug report to red hat. But I want to make sure my code is correct.
    My test case just puts the SwingWorker to sleep
    but the problem occurs if I do something real, like connect to a database, etc.
    Also I have tried little different variations of the logic calling
    setVisible(true)/(false) in different places and the same problem occurs.
    It seems to work with Sun JDK, note I am using IcedTea with Fedora Core 8.
    Version-Release number of selected component (if applicable):
    [szakrews@tuxtel ~]$ java -version
    java version "1.7.0"
    IcedTea Runtime Environment (build 1.7.0-b21)
    IcedTea Client VM (build 1.7.0-b21, mixed mode)How reproducible:
    Every couple times.
    javac TestClass2
    java TestClass2eventually it will hang. If it doesn't try again.
    You don't have to wait for the program to finish either.
    The program runs the Dialog 10 times but it never works or fails in the middle, it will either work or fail from the first dialog displayed.
    I have included a thread dump. That is about the most informative information I can get. Neither tracing nor writing a custom ThreadQueue or Drawing Manager to trace events produces any helpful information.
    Actual results:
    The JProccessBar won't move, and the SwingWorker finishes but the done() method is never run. The PROGRAM is not hung however because if I close the dialog then it will continue.
    Expected results:
    The JProccessBar should always move and the SwingWorker should always run the done() method.
    Additional info:
    java thread dump after freeze, taken with kill -s SIGQUIT <pid>
    2008-06-25 12:25:50
    Full thread dump IcedTea Client VM (1.7.0-b21 mixed mode):
    "DestroyJavaVM" prio=10 tid=0x938afc00 nid=0x1419 waiting on condition
    [0x00000000..0x0018a074]
       java.lang.Thread.State: RUNNABLE
    "AWT-EventQueue-0" prio=10 tid=0x938ae400 nid=0x1429 in Object.wait()
    [0x07f96000..0x07f96f04]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x96748f80> (a java.awt.EventQueue)
            at java.lang.Object.wait(Object.java:503)
            at java.awt.EventQueue.getNextEvent(EventQueue.java:485)
            - locked <0x96748f80> (a java.awt.EventQueue)
            at
    java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:248)
            at
    java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:201)
            at
    java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:195)
            at java.awt.Dialog$1.run(Dialog.java:1073)
            at java.awt.Dialog$3.run(Dialog.java:1127)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Dialog.show(Dialog.java:1125)
            at java.awt.Component.show(Component.java:1456)
            at java.awt.Component.setVisible(Component.java:1408)
            at java.awt.Window.setVisible(Window.java:871)
            at java.awt.Dialog.setVisible(Dialog.java:1012)
            at net.xtel.production.WaitDialog.showWaitDialog(WaitDialog.java:72)
            at net.xtel.production.WaitDialog.showWaitDialog(WaitDialog.java:102)
            at TestClass2.showWait(TestClass2.java:79)
            at TestClass2.createAndShowGUI(TestClass2.java:126)
            at TestClass2.access$0(TestClass2.java:114)
            at TestClass2$3.run(TestClass2.java:138)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:227)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:603)
            at
    java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:276)
            at
    java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:201)
            at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:191)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:186)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:139)
    "AWT-Shutdown" prio=10 tid=0x938ad000 nid=0x1428 in Object.wait()
    [0x03ea7000..0x03ea7f84]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x96749268> (a java.lang.Object)
            at java.lang.Object.wait(Object.java:503)
            at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:281)
            - locked <0x96749268> (a java.lang.Object)
            at java.lang.Thread.run(Thread.java:675)
    "AWT-XAWT" daemon prio=10 tid=0x938a8400 nid=0x1423 runnable
    [0x02ccc000..0x02ccd104]
       java.lang.Thread.State: RUNNABLE
            at sun.awt.X11.XToolkit.waitForEvents(Native Method)
            at sun.awt.X11.XToolkit.run(XToolkit.java:550)
            at sun.awt.X11.XToolkit.run(XToolkit.java:525)
            at java.lang.Thread.run(Thread.java:675)
    "Java2D Disposer" daemon prio=10 tid=0x93854000 nid=0x1421 in Object.wait()
    [0x07aea000..0x07aead84]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x966e7010> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
            - locked <0x966e7010> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:150)
            at sun.java2d.Disposer.run(Disposer.java:143)
            at java.lang.Thread.run(Thread.java:675)
    "Low Memory Detector" daemon prio=10 tid=0x93c15000 nid=0x141f runnable
    [0x00000000..0x00000000]
       java.lang.Thread.State: RUNNABLE
    "CompilerThread0" daemon prio=10 tid=0x93c13400 nid=0x141e waiting on condition
    [0x00000000..0x03a8a954]
       java.lang.Thread.State: RUNNABLE
    "Signal Dispatcher" daemon prio=10 tid=0x93c11c00 nid=0x141d waiting on
    condition [0x00000000..0x00000000]
       java.lang.Thread.State: RUNNABLE
    "Finalizer" daemon prio=10 tid=0x095e7000 nid=0x141c in Object.wait()
    [0x005d2000..0x005d3004]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x966e71d8> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
            - locked <0x966e71d8> (a java.lang.ref.ReferenceQueue$Lock)
            at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:150)
            at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:177)
    "Reference Handler" daemon prio=10 tid=0x095e2400 nid=0x141b in Object.wait()
    [0x00581000..0x00582084]
       java.lang.Thread.State: WAITING (on object monitor)
            at java.lang.Object.wait(Native Method)
            - waiting on <0x966e7260> (a java.lang.ref.Reference$Lock)
            at java.lang.Object.wait(Object.java:503)
            at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:134)
            - locked <0x966e7260> (a java.lang.ref.Reference$Lock)
    "VM Thread" prio=10 tid=0x095dec00 nid=0x141a runnable
    "VM Periodic Task Thread" prio=10 tid=0x93c17400 nid=0x1420 waiting on condition
    JNI global references: 836
    Heap
    def new generation   total 960K, used 152K [0x93f40000, 0x94040000, 0x966a0000)
      eden space 896K,   9% used [0x93f40000, 0x93f56148, 0x94020000)
      from space 64K, 100% used [0x94020000, 0x94030000, 0x94030000)
      to   space 64K,   0% used [0x94030000, 0x94030000, 0x94040000)
    tenured generation   total 4096K, used 1088K [0x966a0000, 0x96aa0000, 0xb3f40000)
       the space 4096K,  26% used [0x966a0000, 0x967b01b0, 0x967b0200, 0x96aa0000)
    compacting perm gen  total 12288K, used 9169K [0xb3f40000, 0xb4b40000, 0xb7f40000)
       the space 12288K,  74% used [0xb3f40000, 0xb4834740, 0xb4834800, 0xb4b40000)
    No shared spaces configured.CLASS1:
    import java.awt.Dimension;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.sql.SQLException;
    import java.util.concurrent.ExecutionException;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.RepaintManager;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import javax.swing.UnsupportedLookAndFeelException;
    public class TestClass2 extends JFrame implements ActionListener {
            /** Action Command for <code>searchbtn</code> */
            public static final String SEARCH_BTN_ACTION = "search_btn_action";
             * Constructor.
            public TestClass2() {
                    setSize(650, 350);
                    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
                    setLocation(screenSize.width / 2 - getSize().width / 2,
                                    screenSize.height / 2 - getSize().height / 2);
                    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                    addWindowListener(new WindowAdapter() {
                            @Override
                            public void windowClosing(WindowEvent e) {
                                    exit();
                    JPanel panel = new JPanel();
                    add(panel);
                    setVisible(true);
            @Override
            public void actionPerformed(ActionEvent e) {
                    if (e.getActionCommand().equals(SEARCH_BTN_ACTION)) {
                            JOptionPane.showMessageDialog(this, "Button Pressed");
            public void showWait() {
                    try {
                            WaitDialog.showWaitDialog(this, "Testing...", new SwingWorkerInterface(){
                                    @Override
                                    public Object workToDo() throws Throwable {
                                            Thread.currentThread().sleep(3000);
                                            return null;
                    } catch (InterruptedException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                    } catch (ExecutionException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
             * Exits the program.
            public void exit(){
                    System.exit(0);
             * Create the GUI and show it. For thread safety, this method should be
             * invoked from the event-dispatching thread.
             * @throws UnsupportedLookAndFeelException
             * @throws IllegalAccessException
             * @throws InstantiationException
             * @throws ClassNotFoundException
             * @throws NullInstanceVariableException
             * @throws SQLException
            private static void createAndShowGUI() {
                    // set look and feel
                    try{
                            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                            // Create instance of the ProductCatalog
                            TestClass2 root = new TestClass2();
                            for(int i = 0; i < 10; i++){
                                    root.showWait();
                    }catch(Exception e){
                            e.printStackTrace();
             * @param args
             *            this program does not use arguments
            public static void main(String[] args) {
                    SwingUtilities.invokeLater(new Runnable() {
                            public void run() {
                                    createAndShowGUI();
    }CLASS 2:
    import java.awt.Component;
    import java.awt.Frame;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.util.concurrent.ExecutionException;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JProgressBar;
    import javax.swing.SwingWorker;
    public class WaitDialog extends JDialog {
            private boolean disposed = false;
            private boolean displayed = false;
            private WorkerThread worker = null;
            WaitDialog(Frame parent, String text, SwingWorkerInterface in){
                    super(parent, true);
                    worker = new WorkerThread(in);
                    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                    addWindowListener(new WindowAdapter() {
                            @Override
                            public void windowOpened(WindowEvent e) {
                                    worker.execute();
                            @Override
                            public void windowClosing(WindowEvent e) {
                                    disposeWaitDialog();
                    this.setResizable(false);
                    JLabel message = new JLabel();
                    message.setText(text);
                    JProgressBar pb = new JProgressBar();
                    pb.setIndeterminate(true);
                    // set size and location
                    setSize(200, 100);
                    setLocationRelativeTo(parent);
                    JPanel panel = new JPanel();
                    panel.add(message);
                    panel.add(pb);
                    add(panel);
            public void showWaitDialog(){
                    if(displayed == true){
                            return;
                    if(disposed == true){
                            disposed = false;
                            return;
                    disposed = false;
                    displayed = true;
                    setVisible(true);
            public void disposeWaitDialog(){
                    if(disposed == true){
                            return;
                    if(displayed == true){
                            displayed = false;
                            setVisible(false);
                            return;
                    disposed = true;
                    displayed = false;
            public static Object showWaitDialog(Component parent, String text, SwingWorkerInterface in) throws InterruptedException, ExecutionException {
                    WaitDialog waitDialog = null;
                    if (parent == null) {
                            waitDialog = new WaitDialog(JOptionPane.getRootFrame(), text, in);
                    } else {
                            waitDialog = new WaitDialog(JOptionPane.getFrameForComponent(parent), text, in);
                    while(!waitDialog.worker.isDone()){
                            System.out.println("about to show");
                            waitDialog.showWaitDialog();
                            System.out.println("done showing");
                    waitDialog.dispose();
                    return waitDialog.worker.get();
            class WorkerThread extends SwingWorker<Throwable, Void> {
                    private SwingWorkerInterface in = null;
                    WorkerThread(SwingWorkerInterface in){
                            this.in = in;
                    public Throwable doInBackground(){
                                    try {
                                            System.out.println("about to do work");
                                            in.workToDo();
                                            System.out.println("done work no exception");
                                    } catch (Throwable e) {
                                            System.out.println("done work with exception");
                                            return e;
                                    return null;
                    public void done(){
                                    System.out.println("about to dispose");
                                    disposeWaitDialog();
                                    System.out.println("disposed");
    }CLASS 3:
    public interface SwingWorkerInterface {
            public Object workToDo() throws Throwable;
    }

    There's nothing directly wrong with it, but it will
    prevent other threads acquiring the class lock - but
    that may be what you want.True. Although the typical case for code that looks like this would be to use wait--usually the various threads in question require the same lock, so you have to use wait in order for the waiting thread to give it up and allow the other thread to do its work. Hard to say for sure though what he's doing.
    Also, if loading is all that the other thread does, and you're waiting for that thread to die, use join. But then, if that's the case, and you're only waiting for a single other thread, then you might as well just put it all in one thread, as already indicated.

  • Information Regarding :Exception occurred during event dispatching

    Hi,
    I frequently get this exception when I click a button in a dialog and it opens up another frame of window. The exception trace includes java internal classes and my program classes line numbers. I have searched the net but could not get any concrete answer.
    Is this problem in java packages or should we take care of something in our code to avoid such exceptions.
    Below is the exception trace..........................
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1141)
    at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
    at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
    at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
    at javax.swing.JComponent.paintComponent(JComponent.java:541)
    at javax.swing.JComponent.paint(JComponent.java:808)
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4795)
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4748)
    at javax.swing.JComponent._paintImmediately(JComponent.java:4692)
    at javax.swing.JComponent.paintImmediately(JComponent.java:4495)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:409)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
    at java.awt.Dialog$1.run(Dialog.java:540)
    at java.awt.Dialog.show(Dialog.java:561)
    at java.awt.Component.show(Component.java:1192)
    at java.awt.Component.setVisible(Component.java:1147)
    at com.mycomp.example.DialogView.showWindow(DialogView.java:91)
    at com.mycomp.example.showWindow(StatusController.java:83)
    at com.mycomp.example.handleOk(ExampleController.java:842)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5159)
    at java.awt.Component.processEvent(Component.java:4956)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3674)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    Thanks in advance.

    Hi All,
    Thanks for the replies and information posted by you.
    Below is some code snippet: ( complete code posting is difficult) ;-)
    Dialog1 is open, clicking on button say start it hides the current Dialog1 and opens the status dialog for Dialog1.
    Also, we are making the current Thread to sleep to avoid flickering.
    dialog1.hideWindow(); // Hide current window...
    Thread.currentThread().sleep(5); // sleep to avoid flickering..
    statusDialog.showWindow(); // to display status window..
    I will check and try to do modifications as per your suggestions.
    Thanks.

  • Exception occurred during event dispatching:java.lang.NoSuchMethodError

    Hello,
    We have upgraded to the latest Oracle Application Server version 10.1.2.3.0 and the webutil version is 1.0.6.
    But we face the following error while accessing the web link. Following message captured from Java Console.
    Please suggest if you have any solutions/idea about this error. Thanks !
    Oracle JInitiator: Version 1.3.1.22
    Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
    Maximum size: 50 MB
    Compression level: 0----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    q: hide console
    s: dump system properties
    t: dump thread list
    x: clear classloader cache
    0-5: set trace level to <n>
    Downloading http://si02938.in.irt.com:7778/forms/java/frmall_jinit.jar to JAR cacheDownloading http://si02938.in.irt.com:7778/forms/java/frmwebutil.jar to JAR cacheDownloading http://si02938.in.irt.com:7778/forms/java/jacob.jar to JAR cacheDownloading http://si02938.in.irt.com:7778/forms/java/FileInformation.jar to JAR cacheDownloading cacheproxyHost=nullproxyPort=0connectMode=HTTP, native.
    Forms Applet version is : 10.1.2.3
    Exception occurred during event dispatching:java.lang.NoSuchMethodError     at oracle.forms.webutil.common.VBeanCommon.init(VBeanCommon.java:281)     at oracle.forms.handler.UICommon.instantiate(Unknown Source)     at oracle.forms.handler.UICommon.onCreate(Unknown Source)     at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)     at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)     at oracle.forms.engine.Runform.processMessage(Unknown Source)     at oracle.forms.engine.Runform.processSet(Unknown Source)     at oracle.forms.engine.Runform.onMessageReal(Unknown Source)     at oracle.forms.engine.Runform.onMessage(Unknown Source)     at oracle.forms.engine.Runform.processEventEnd(Unknown Source)     at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)     at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)     at java.awt.Component.dispatchEventImpl(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.EventQueue.dispatchEvent(Unknown Source)     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     at java.awt.EventDispatchThread.run(Unknown Source)
    Edited by: user12233243 on Nov 16, 2009 10:28 PM
    Edited by: user12233243 on Nov 16, 2009 10:29 PM

    hi
    read the following configuration i hope it will help u.
    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    [OraHome] with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
    and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
    [JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
    cd [JacobStage]
    copy jacob.jar [OraHome]\forms\java\.
    copy jacob.dll [OraHome]\forms\webutil\.
    The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
    Open a DOS command prompt.
    Add [OraHome]\jdk\bin to the PATH:
    set PATH=[OraHome]\jdk\bin;%PATH%
    Sign the files, and check the output for success:
    [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
    [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
    you may skip this step. Otherwise,
    Create a schema to hold the WebUtil stored code, and privileges needed to
    connect and create a stored package. Schema name "WEBUTIL" is recommended
    for no reason other than consistency over the user base.
    Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
    out the EXIT statement, to be able to see whether the objects were created witout
    errors.
    Start SQL*Plus as SYSTEM, and issue:
    CREATE USER webutil IDENTIFIED BY [password]
    DEFAULT TABLESPACE users
    TEMPORARY TABLESPACE temp;
    GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
    CONNECT webutil/[password]@[connectstring]
    @[OraHome]\forms\create_webutil_db.sql
    -- Inspect SQL*Plus output for errors, and then
    CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
    Reconnect as SYSTEM, and issue:
    grant execute on webutil_db to public;
    5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
    to the CLASSPATH entry.
    6) Start the OC4J instance
    7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
    Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
    It is important to generate the PLX, to avoid the FRM-40039 discussed in
    Note 303682.1
    If the PLX is not generated, the Webutil.pll library would have to be attached with
    full path information to all forms wishing to use WebUtil. This is NOT recommended.
    8) Create a new FMB.
    Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
    There is no need to Subclass the WebutilConfig object.
    Attach the Webutil.pll Library, and remove the path.
    Add an ON-LOGON trigger with the code
    NULL;
    to avoid having to connect to an RDBMS (optional).
    Create a new button on a new canvas, with the code
    show_webutil_information (TRUE);
    in a WHEN-BUTTON-PRESSED trigger.
    Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
    the "Application Server URL" is empty.
    Then append "?config=webutil" at the end, so you end up with a URL of the form
    http://server:port/forms/frmservlet?config=webutil
    10) Run your form.
    If its Correct/Helpful please mark it thanks.
    Sarah

  • Exception occurred during event dispatching: ArrayIndexOutOfBoundsException

    Java GUI app that runs fine in NT, ported over to Linux (sparc), recompiled and I get the following traceback when I run it, happens whenever I generate a SWING event. JDK 1.3.0. I have the same problem with the swingset sample app as well:
    Exception occurred during event dispatching:
    java.lang.ArrayIndexOutOfBoundsException: -1017
         at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:1485)
         at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:1355)
         at java.awt.Component.dispatchEventImpl(Component.java:2509)
         at java.awt.Container.dispatchEventToSelf(Container.java:1233)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2449)
         at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:2314)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2189)     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
         at java.awt.Container.dispatchEventImpl(Container.java:1200)
         at java.awt.Window.dispatchEventImpl(Window.java:912)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:333)
         at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:103)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
    Here is also a small sample piece of code that makes it happen too. Whever I "hover" over the button this occurs.
    public class Test
    public static void
    main(String[] argv)
    throws Exception
    // set up GUI
    JFrame frame = new JFrame();
    frame.setBounds(0, 0, 100, 100);
    JPanel panel = new JPanel();
    frame.getContentPane().add(panel);
    panel.setLayout(new BorderLayout());
    panel.add(new JButton("Push me"), BorderLayout.NORTH);
    panel.add(new JLabel("Hello world"), BorderLayout.CENTER);
    frame.pack();
    frame.setVisible(true);
    return;

    In the case of this problem, it happens EVERY TIME I run the application (and happens with Swingset too) and it DOES affect the application. I can't click on buttons, etc. All swing events seem to generate this trace back. I tried recompiling all the code thinking I might have a bad class file or something, but to no avail. Could this be a version mis-match? I'm running Linux 6.2.

  • Eventhandlers of children of application can not receive custom event dispatched by application

    Hello dear Adobe community,
    hope you can help me with this issue.
    When the application dispatches a custom event, the child uicomponent can only receive the event by using Application.application.addEventListener or systemManager.addEventListener. Simply adding a listener, without application or systemmanager, does not allow the event to be received by the child component.
    I want to be able to use the addEventListener and removeEventListener without SystemManager or Application.application, or could you provide a better workaround? How can I use the addEventListener, do I need to overwrite EventDispatcher, which I wouldnt like to do?
    Just to clarifiy, if i remove the systemManager in front of addEventListener(CustomEventOne.EventOne,sysManHandleCE,false) it will not add it and will not fire. 
    The code below is an example for this problem that the event is not getting fired in the right moment. The mainapplication got only a button with the customEventOne that gets dispatched.
    public
    class MyCanvas extends Canvas{
    public function MyCanvas()
    super();
    width=300;
    height=300;
    addEventListener(FlexEvent.CREATION_COMPLETE,handleCC,false,0,true);
    private function handleCC(event:FlexEvent):void
    removeEventListener(FlexEvent.CREATION_COMPLETE,handleCC);
    addEventListener(CustomEventOne.EventOne,handleCE,false,0,true);
    addEventListener(Event.REMOVED_FROM_STAGE,handleEvt,false,0,true);
    systemManager.addeventListener(CustomEventOne.eventOne,sysManHandleCE,false,0,true);
    private function handleEvt(event:Event):void
    trace("In removed from stage handler");
    systemManager.removeEventListener(CustomEventOne.EventOne,sysManHandleCE);
    trace(hasEventListener(FlexEvent.CREATION_COMPLETE));
    trace(hasEventListener(CustomEventOne.EventOne));
    trace(hasEventListener(Event.REMOVED_FROM_STAGE));
    private function handleCE(event:CustomEventOne):void
    trace("I got it");
    private function sysManHandleCE(event:CustomEventOne):void
    trace("I got it");
    public class CustomEventOne extends Event
    public static const EventOne:String = "EventOne";
    public function CustomEventOne(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
    super(type, bubbles, cancelable);
    override public functionclone():Event
    return newCustomEventOne(type,bubbles,cancelable);
    Thank you in advance,
    Michael

    I think you need to look at event propogation. The object that dispatches an event will be sitting on the display tree. The event propagates up the tree to the roots. Your canvas should be attached to the application, but even then it sits lower in the tree branches than the event dispatcher, so it won't see the event being dispatched because the event is not propagated to the children of the object that dispatches it but to the parent of the object that dispatches it.
    So, your canvas is a child of the application, but dispatching the event from the application means that the canvas doesn't see it because events are notified up the tree using the parent link, not the child links.
    You may wish to investigate how the display list and event propagation works and then the MVC pattern.
    Paul

  • Exception occurred during event dispatching:java.security.AccessControlExce

    Hi,
    I' m getting an error while connecting to database ORACLE 9i.
    I'm using JDK 1.6.0
    Actually the code is about how an Japplet connects to database ORACLE 9i
    when i was connecting using normal program i had got the connection easily .
    When i used this JApplet ,i'm getting this error.
    CODE:
    import java.awt.*;
    import javax.swing.* ;
    import java.sql.*;
    import java.awt.event.*;
    import java.util.*;
    /*<applet code="jln" width=400 height=400></applet>*/
    public class jln extends JApplet
    public void init()
    JTabbedPane jtp=new JTabbedPane();
    jtp.addTab("View Marks",new VmPanel());
    getContentPane().add(jtp);
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    } catch (Exception e)
    {              e.printStackTrace();
    System.out.println("Failed to load driver.");
    class VmPanel extends JPanel implements ActionListener
    JButton b1,b2;
    TextArea ta1;
    JTextField jtf1;
    Connection con=null;
    public VmPanel()
    b1=new JButton("ok!");
    b2=new JButton("clear");
    ta1=new TextArea();
    jtf1=new JTextField(10);
    add(jtf1);
    add(b1);
    add(b2);
    add(ta1);
    b1.addActionListener(this);
    b2.addActionListener(this);
    public void actionPerformed(ActionEvent ae)
    String str1=ae.getActionCommand();
    if(str1=="ok!")
    try
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:jlngbldb", "scott", "tiger");
    Statement stmt = con.createStatement ();
    String ht=jtf1.getText();
    System.out.println("\nHello\n");
    ResultSet rs = stmt.executeQuery("SELECT * FROM jln WHERE ht='"+ht+"'");
    while(rs.next())
    ta1.setText ("");
    ta1.setText("Name:"+rs.getObject("name")+"HallTicket:"+rs.getObject("ht")+"C.G:"+rs.getObject("cg")+"C.D:"+rs.getObject("cd")+"UNIX:"+rs.getObject("unix")+" S.T.M:"+rs.getObject("stm")+"N.N:"+rs.getObject("nn")+"I.S:"+rs.getObject("ins"));
    rs.close();
    stmt.close();
    con.close();
    catch(SQLException ex)
    System.err.println("SQLException: " + ex.getMessage());
    if(str1=="clear")
    ta1.setText("");
    jtf1.setText("");
    if(str1==null)
    ta1.setText ("");
    ta1.setText("Please enter Hall Ticket Number above....");
    }//action performed close
    }//panel closed
    AND THE ERROR IS:
    Exception occurred during event dispatching:
    java.security.AccessControlException: access denied (java.util.PropertyPermissio
    n oracle.jserver.version read)
    at java.security.AccessControlContext.checkPermission (AccessControlConte
    xt.java:321)
    at java.security.AccessController.checkPermission(AccessController.java:
    546)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:12
    85)
    at java.lang.System.getProperty(System.java:627)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:433)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(DriverManager.java:548)
    at java.sql.DriverManager.getConnection(DriverManager.java :180)
    at VmPanel.actionPerformed(jln.java:60)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
    63)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
    a:2183)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
    .java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased (BasicButtonL
    istener.java:234)
    at java.awt.Component.processMouseEvent(Component.java:5921)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3316)
    at java.awt.Component.processEvent (Component.java:5686)
    at java.awt.Container.processEvent(Container.java:1960)
    at java.awt.Component.dispatchEventImpl(Component.java:4360)
    at java.awt.Container.dispatchEventImpl(Container.java :2018)
    at java.awt.Component.dispatchEvent(Component.java:4194)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4222
    at java.awt.LightweightDispatcher.processMouseEvent (Container.java:3886)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3816)
    at java.awt.Container.dispatchEventImpl(Container.java:2004)
    at java.awt.Component.dispatchEvent (Component.java:4194)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:592)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
    ad.java:270)
    at java.awt.EventDispatchThread.pumpEventsForFilter (EventDispatchThread.
    java:198)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:171)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:166)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:158)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:119)
    I'm getting this error when i pressed the OK! JButton.
    PLEASE ! help me by correcting this error.
    Thank You.

    Presumably you are running this via a browser where the applet is served from the server.
    Applets can only connect back to the origination server and using the name that the origination server was accessed with.
    And that has nothing to do with JDBC, all connections work that way.
    Your driver uses a connection thus it will not work unless it attempts to connect to the server that originated the applet.
    Solutions
    1. Connect to the server
    2. Sign the applet
    3. Modify the policy file of each client that will run the applet. This is not a good idea in an unsecure network.
    Note as well that in an unsecure network is most often a bad policy to have an applet directly accessing a database regardless.

  • Exception during event dispatching - Dont want to use Swing.invokeLater()

    I am getting NullpointerException while event dispatching. I am using threads, where each thread executes soem functions and one synchonized method to update graphics (table.updateUI())
    I am using thread.start to invoke the threads and not SwinUtilities.invokelater(). I know this is the problem because threads which update graphics should be invoked by invokelater, so that they are in queue in the awt event thread.
    But the method that updates gui is a synchonized method, so there should not be any collision. Also invokelater runs through all the threads and then invokes each, this reduces performance.
    Any help is very much appreciated.
    Thanks,
    JavaSeems.

    Hi Teka,
    Thanks for the response.
    Ok following is the exception i get :-
    Exception occurred during event dispatching:java.lang.NullPointerException     at sun.awt.RepaintArea.paint(RepaintArea.java:300)     at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:196)     at java.awt.Component.dispatchEventImpl(Component.java:2663)     at java.awt.Container.dispatchEventImpl(Container.java:1213)     at java.awt.Component.dispatchEvent(Component.java:2497)     at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
    I read soem thread stuff and soem forums, all say that whenever thread updates gui, dont invoke them using start method, use invokelater. But that degrades performance, also all threads dont run simulanouelsy.
    There will be a minimum of 6 threads in my program which will run for the lifetime of the dialog, so i need all of them to run simulatenoussly. But invokelater queues them in the awt evnt thread one after the other, and they dont run together.
    The thread will update gui by methods like tabelmodel.updateRow, Table.updategui. I see exceptions after these statements.
    Does this info help?

  • Exception during event dispatching...

    Hello, Here is the Exception.
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    int oracle.dacf.control.NavigationManager._getChangeLevel(java.lang.String, java.lang.String, boolean)
    boolean oracle.dacf.control.NavigationManager._canChangeFocus(boolean)
    boolean oracle.dacf.control.NavigationManager.validateFocusChange(oracle.dacf.control.Control)
    void oracle.dacf.control.swing.ButtonControl.focusGained(java.awt.event.FocusEvent)
    void java.awt.AWTEventMulticaster.focusGained(java.awt.event.FocusEvent)
    void java.awt.Component.processFocusEvent(java.awt.event.FocusEvent)
    void javax.swing.JComponent.processFocusEvent(java.awt.event.FocusEvent)
    Any help? Thanks.
    null

    Hi Teka,
    Thanks for the response.
    Ok following is the exception i get :-
    Exception occurred during event dispatching:java.lang.NullPointerException     at sun.awt.RepaintArea.paint(RepaintArea.java:300)     at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:196)     at java.awt.Component.dispatchEventImpl(Component.java:2663)     at java.awt.Container.dispatchEventImpl(Container.java:1213)     at java.awt.Component.dispatchEvent(Component.java:2497)     at java.awt.EventQueue.dispatchEvent(EventQueue.java:339)     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
    I read soem thread stuff and soem forums, all say that whenever thread updates gui, dont invoke them using start method, use invokelater. But that degrades performance, also all threads dont run simulanouelsy.
    There will be a minimum of 6 threads in my program which will run for the lifetime of the dialog, so i need all of them to run simulatenoussly. But invokelater queues them in the awt evnt thread one after the other, and they dont run together.
    The thread will update gui by methods like tabelmodel.updateRow, Table.updategui. I see exceptions after these statements.
    Does this info help?

  • Exception occurred during event dispatching: java.lang.UnsatisfiedLinkError

    Hi,
    Greetings. I am watching the following error in linux. I greatly appreciate your help.
    Thanks
    Rajkumar
    Exception occurred during event dispatching:
    java.lang.UnsatisfiedLinkError: no test in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517)
    at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:834)
    at test.<clinit>(test.java:3)
    at Test.action(Main27.java:926)
    at java.awt.Component.handleEvent(Component.java:5341)
    at Test.handleEvent(Main27.java:1023)
    at java.awt.Window.postEvent(Window.java:1614)
    at java.awt.Component.postEvent(Component.java:3895)
    at java.awt.Component.dispatchEventImpl(Component.java:3631)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
    at java.awt.Dialog$1.run(Dialog.java:542)
    at java.awt.Dialog$3.run(Dialog.java:569)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Dialog.show(Dialog.java:567)
    at Main27.first(Main27.java:67)
    at Main27.action(Main27.java:163)
    at java.awt.Component.handleEvent(Component.java:5341)
    at java.awt.Component.postEvent(Component.java:3885)
    at java.awt.Component.postEvent(Component.java:3895)
    at java.awt.Component.postEvent(Component.java:3895)
    at java.awt.Component.dispatchEventImpl(Component.java:3631)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    In your test.java (Which must be yours, since all serious classes have capitalised names) you are trying to load a JNI library with
    static {
       System.loadLibrary("test");
      }Somewhere you should have a library file, I think called libtest.so, but the JVM can't find it.
    Find out where it is and put -Djava.library.path=<the directory>
    on the java command.

  • Exception during Event Dispatch

    hi
    I am executing a particular Swing program which throws up the following exception when a particular button is clicked
    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: javax/mail/MessagingException
         at rclient.<init>(rclient.java:83)
         at clientgui.actionPerformed(clientgui.java:357)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1450)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1504)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:378)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:250)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:216)
         at java.awt.Component.processMouseEvent(Component.java:3717)
         at java.awt.Component.processEvent(Component.java:3546)
         at java.awt.Container.processEvent(Container.java:1167)
         at java.awt.Component.dispatchEventImpl(Component.java:2595)
         at java.awt.Container.dispatchEventImpl(Container.java:1216)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2458)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2223)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2132)
         at java.awt.Container.dispatchEventImpl(Container.java:1203)
         at java.awt.Window.dispatchEventImpl(Window.java:918)
         at java.awt.Component.dispatchEvent(Component.java:2499)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:336)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:134)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:101)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:96)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:88)
    This exception is thrown in some computers but not in the others. Can any one let me know the reason as to why this happens? This is very urgent..... please.

    If you are facing problems in compiling the class files, you can either put the mail.jar and activation.jar any folder and append it to the classpath or put the jar files in the jre/lib/ext folder. If you are facing problems at runtime, then u need put the jar files in the application/web-inf/lib folder.
    Let me know if you need more help.
    Regards,
    Ajit

  • Event dispatching exception thrown when invoking a webpage in a JEditorPane

    I have a help option in one of the menus of my tool. When this help option is chosen from the menu, the tool invokes a frame which is of JEditorPane type and displays an HTML doc in it. Here is the stack trace I am getting.
    My problem is I get this error only on Unix platforms (Solaris) and despite the exception being thrown the application works alright. Although the help frame has serious performance issues, it takes a while for this frame to load the html doc in it and display it (the html file is about 8 pages long).
    Please let me know how to get rid of this exception. Thanks in advance. Here is the stack trace of the exception I am getting:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.text.LabelView.syncFragments(Compiled Code)
    at javax.swing.text.LabelView.getPreferredSpan(Compiled Code)
    at javax.swing.text.ParagraphView.layoutRow(Compiled Code)
    at javax.swing.text.ParagraphView.rebuildRows(Compiled Code)
    at javax.swing.text.ParagraphView.layout(ParagraphView.java:216)
    at javax.swing.text.BoxView.setSize(BoxView.java:259)
    at javax.swing.text.BoxView.layout(Compiled Code)
    at javax.swing.text.BoxView.setSize(BoxView.java:259)
    at javax.swing.text.BoxView.layout(Compiled Code)
    at javax.swing.text.BoxView.setSize(BoxView.java:259)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(Compiled Code)
    at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(Compiled Code)
    at javax.swing.JComponent.getPreferredSize(Compiled Code)
    at javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:991)
    at javax.swing.ScrollPaneLayout.layoutContainer(Compiled Code)
    at java.awt.Container.layout(Compiled Code)
    at java.awt.Container.doLayout(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validateTree(Compiled Code)
    at java.awt.Container.validate(Compiled Code)
    at java.awt.Window.dispatchEventImpl(Compiled Code)
    at java.awt.Component.dispatchEvent(Compiled Code)
    at java.awt.EventQueue.dispatchEvent(Compiled Code)
    at java.awt.EventDispatchThread.pumpOneEvent(Compiled Code)
    at java.awt.EventDispatchThread.pumpEvents(Compiled Code)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)

    I am still at a loss, any help/ tips/ guidance is welcome to solve this problem. thanks in advance.

  • Adobe AIR Event Dispatcher Problem

    I have created an AIR application, I have removed an component and  again i added the same component. That time the event dispatcher of the removed component is been called again and again.How to resolve this problem. Urgent Reply ASAP......

    The only idea that comes to mind is to keep the file on the dvd, then have your app install (copy) it on first launch.
    Thanks for adding the bug.  For others affected by this, please visit the bug and add your vote.  All feedback is appreciated!
    https://bugbase.adobe.com/index.cfm?event=bug&id=2938315
    Chris

  • Event dispatching to swing components

    Hi,
    I'm implementing an extension of JTextPane, and I would like to make it as much reusable as possible.
    In order to do this, the class don't have to know about the external world (components)..
    The class should notify events (e.g. an event could be that a specific string has been typed..) to the other components just sending a message (or event), and all the components registered to that specific event implement their behavior to react to it.. quite simple..
    which is the simplest solution in Java to do this?
    thanks in advance..

    You should implement event dispatching based on the listener model, for consistency. Since you are extending JTextPane, a lot of the event dispatching code is written for you. Look up JTextPane in the javadocs and check out all the classes it is derived from. To take advantage of the already written listener code, simply call the appropriate fireWhateverEvent method whenever something happens. That will cause the event to be dispatched to all listeners registered with that component. If you want to define some new events that aren't covered by any of the listener methods in any of the classes your new class is derived from, here's the general way to do it:
    1) Define a new listener interface that implements the EventListener interface (which contains no methods).
    2) In your new listener interface, include methods for specific events, such as keyPressed, actionPerformed, textTyped, etc...
    3) Each of these methods should take a single parameter describing the event. This parameter should be a class that extends EventObject and that contains data relevant to your event. For example, you may define a TextEvent class that extends EventObject. The only methods EventObject has is getSource() and toString(). You won't really need to override these as long as you call the EventObject(Object) constructor from your TextEvent constructors.
    4) In your JTextPane derived class, define methods that can add, remove, and get a list of all registered event listeners for your event (ex: void addTextListener(TextListener t), void removeTextListener(TextListener t), TextListener[] getTextListeners()).
    5) add*Listener should add the listener to an internal list of listeners (a LinkedList or a Vector are good ways to store the registered listener lists). remove*Listener should remove the listener from the list, and get*Listeners should return the list in array form.
    6) For ease-of-use, define a fire method like fireTextListener(params), which creates a new TextEvent (assuming you're doing the TextListener thing) holding the specified event data and iterates through the internal list of listeners, calling the appropriate method in each one and passing your TextEvent to it.
    7) Call your fire*Event functions wherever appropriate to fire events.
    It's simpler than it sounds. Here's a small example:
    // TextListener.java
    public class TextListener implements EventListener {
        public void textInserted (TextEvent e);
        public void textDeleted  (TextEvent e);
    // TextEvent.java
    public class TextEvent extends EventObject {
        protected int    pos0;
        protected int    pos1;
        protected String text;
        public TextEvent (Object source, int pos0, int pos1, String text) {
            super(source);
            this.pos0 = pos0;
            this.pos1 = pos1;
            this.text = (text != null) ? text : "";
        public TextEvent (Object source, int pos0, int pos1) {
            this(source, pos0, pos1, null);
        public int getPos0 () {
            return pos0;
        public int getPos1 () {
            return pos1;
        public String getText () {
            return text;
    // MyTextPane.java
    public class MyTextPane extends JTextPane {
        LinkedList textListeners = new LinkedList();
        // This is just some method you defined, can be anything.
        public void someMethodThatInsertsText () {
            fireTextInserted(pos0, pos1, textInserted);
        // Same with this, this can be anything.
        public void someOtherMethodThatDeletesText () {
            fireTextDeleted(pos0, pos1);
        public void addTextListener (TextListener t) {
            textListeners.add(t);
        public void removeTextListener (TextListener t) {
            textListeners.remove(t);
        public TextListener[] getTextListeners () {
            TextListener ts = new TextListener[textListeners.size()];
            Iterator     i;
            int          j;
            // Don't think toArray works good because I'm 99% sure you'll
            // have trouble casting an Object[] to a TextListener[].
            for (j = 0, i = textListeners.iterator(); i.hasNext(); j ++)
                ts[j] = (TextListener)i.next();
        protected fireTextInserted (int pos0, int pos1, String text) {
            TextEvent e = new TextEvent(this, pos0, pos1, text);
            Iterator  i = textListeners.iterator();
            while (i.hasNext())
                ((TextListener)i.next()).textInserted(e);
        protected void fireTextDeleted (int pos0, int pos1) {
            TextEvent e = new TextEvent(this, pos0, pos1);
            Iterator  i = textListeners.iterator();
            while (i.hasNext())
                ((TextListener)i.next()).textDeleted(e);
    };There. I just typed that there, didn't test or compile it, but you get the gist of it. Then, like you do with any listener stuff, when you want to set up a listener and register it with a MyTextPane instance, just create some class that extends TextListener and overrides textInserted and textDeleted to do whatever your application needs to do.
    Hope that makes sense.
    Jason

  • MouseMove event dispatching

    I noticed a confusing behavior
    regarding event dispatching when a control holds a
    mouse event.
    Usually, in a standard GUI framework, when you resize a
    spliter, the event is not dispatched to other control.
    it's not the case with a flex spliter. The event is thrown to
    all controls the mouse moves over during the drag of the spliter.
    how can we stop that?
    thanks

    After some internal discussion, I hear that this is not a bug
    after all. Here is the recommendation (from our dev team) for you
    to get all of your mouse events to one target -
    1- add a mousedown handler to their component.
    2. in the mousedown handler, add a mousemove and mouseup
    handler to the systemManager. These handlers should be registered
    for capture.
    3. in those handlers, do what you need to do, then stop
    propogation of the event (see the methods on the event class).
    4. in the mouseup handler, remove the mousemove and mouseup
    handlers. make sure you remove them from the system manager, and
    also set the capture flag in the remove.
    HTH,
    Joan

Maybe you are looking for

  • HT2845 Mac Pro and bluetooth compatibility

    I have a Mac Pro that has OS Lion installed, but bluetooth doesn't seem to be available on the computer. I am trying to connect a Magic Mouse. What is the best way to do so? Is the USB-bluetooth method the easiest and cheapest?

  • MSI VGA not working, HELP

    I have installed a geforce 440 64mb ddr to replace an older Viper II video card.  Now I can no longer view the boot process or view the BIOS when I hit delete.  This does not stop Windows from loading correctly.  What could be the problem, since my o

  • Rollback Adobe Reader version on Mac OSX 10.6

    Hello all, I recently upgraded to Adobe Reader version 9.2. I use a drm software on my machine from Oracle that is not compatible with 9.2. I need to roll back to 9.1 I went into my applications folder and deleted Adobe Reader 9.2. searched for all r

  • Database data to nested xml structure

    Hi All, I need to convert the data in the oracle database to nested xml tree structure as below: Data in the database is in the following structure: 1     branch1     13-JAN-11     a.txt 1     branch1     25-JAN-11     b.txt 1     branch1     25-JAN-

  • OSB: Issue while testing OSB proxy service using SOAPUI

    Hi, I am trying to test an OSB proxy service using SOAPUI. The below are the steps i have followed in SOAPUI: 1. File->New SOAPUI project 2. Opens the dialog to create REST service 3. Given service endpoint as: http://<osb servername>:<port> 4. Opens