Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Catch an Exception right

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Catch an Exception right

    Hello,

    I have a problem, so I hope you can help me guys.
    What I have:
    CLASS A extends thread implements Observer;
    I this class occur several exceptions, I would like to notify about them by using gui,
    and I dont wonna call GUI "components from the inside class A". I wanted to make CLASS
    A observable, but Java does not support multi inheritance.. is it possible somehow
    add listener or observer to this class A?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Catch an Exception right

    I think you might have to explain your requirements a lot more, as your post above doesn't make much sense. Interfaces help deal with multiple inheritance - if this is what you need, then define and implement an interface

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Catch an Exception right

    I have solved this problem by setting a reference to Observer. I'll try to explain my situation better next time.

Similar Threads

  1. how do i try/catch this?
    By safra in forum Exceptions
    Replies: 6
    Last Post: October 29th, 2011, 11:14 AM
  2. [SOLVED] Problems with Try/Catch Catching Wrong Exception
    By bgroenks96 in forum What's Wrong With My Code?
    Replies: 14
    Last Post: June 10th, 2011, 08:08 PM
  3. How do I catch a AWT-EventQueue-0
    By aussiemcgr in forum Java Theory & Questions
    Replies: 6
    Last Post: November 5th, 2010, 09:41 PM
  4. catch all
    By silverspoon34 in forum Exceptions
    Replies: 1
    Last Post: November 29th, 2009, 02:18 PM
  5. try/catch
    By rsala004 in forum Exceptions
    Replies: 5
    Last Post: July 19th, 2009, 03:20 PM