This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Florin Florentin wrote:I know it is not possible to extend two classes in Java.
Yep. Java doesn't allow multiple inheritance, and for good reason.
I want to ask you what trick can i do to extend Observable on a Form(who extends javax.swing.JFrame) ?
1) In most situations, you shouldn't subclass JFrame. Instead have your GUI programs create a JPanel, and then when you are ready to view the main app, create the JFrame on the fly and place your JPanel into the JFrame's contentPane. Usually it is unnecessary to subclass JPanel but instead extend your classes through composition rather than inheritance (google these terms for some interesting articles).
2) Also, you could just not use Java's ready-made Observer/Observable classes/interfaces and instead roll your own. They're super easy to make and educational too.