MDI Application using MT4J
Posted: 22 May 2012 07:42 AM   [ Ignore ]
Rank
Joined  2012-05-16
Total Posts:  3
New Member

Hi,

I would create an Java application. The application should have one main panel and several sub-dialogs (panels). Each dialog should present separate mt4j component/applet. Is it possible using Mt4J and Swing?
The important there is that user can close dialog which display MT4J Scene and reopen it later (as a new scene)

Thanks,
Andrew

Profile
 
 
Posted: 22 May 2012 08:58 AM   [ Ignore ]   [ # 1 ]
Avatar
RankRankRankRank
Joined  2008-04-30
Total Posts:  612
Elite

as it is, MT4j is not designed to allow more than 1 instance of MTApplcation..

 Signature 

MT4j - Multi-Touch for Java!

Profile
 
 
Posted: 23 May 2012 12:55 AM   [ Ignore ]   [ # 2 ]
Rank
Joined  2012-05-16
Total Posts:  3
New Member
TherioN - 22 May 2012 08:58 AM

as it is, MT4j is not designed to allow more than 1 instance of MTApplcation..

Unfortunately ... However maybe is it possible to have only one instance per application (but not as a main application window, some kind of singelton pattern) and then share this instance by sub-dialogs that belong to the application?

Thanks,

Profile
 
 
Posted: 24 May 2012 04:27 AM   [ Ignore ]   [ # 3 ]
Avatar
RankRankRankRank
Joined  2008-04-30
Total Posts:  612
Elite

That scenario could be possible. Worth a try anyway smile

 Signature 

MT4j - Multi-Touch for Java!

Profile
 
 
Posted: 25 May 2012 01:00 AM   [ Ignore ]   [ # 4 ]
Rank
Joined  2012-05-16
Total Posts:  3
New Member
TherioN - 24 May 2012 04:27 AM

That scenario could be possible. Worth a try anyway smile

Trying but I’m afraid it’s not so simple as i thought. I’m not sure that it is possible without changing code of mt4j. I’ve experienced casting and locks problems. In addition i have other problem - while loading more complex model (more complex than the 3d example one) ArrayOfOfBound exception it trown

Profile
 
 
Posted: 29 May 2012 08:50 AM   [ Ignore ]   [ # 5 ]
Avatar
RankRankRankRank
Joined  2008-04-30
Total Posts:  612
Elite

Please post the exact error messages and some code. Maybe we can help. Remember that if you want to manipulate the java swing stuff, to do it in the swing thread or use SwingUtilities.invokeLater(...) and if you want to do MT4j stuff from Swing do mtApplication.invokeLater(..) to avoid thread issues.

 Signature 

MT4j - Multi-Touch for Java!

Profile
 
 
Posted: 29 May 2012 09:42 AM   [ Ignore ]   [ # 6 ]
Avatar
Rank
Joined  2012-04-15
Total Posts:  38
New Member

To have several subdialogs, make something like:

public class Mainclassname extends JFrame

then, in an inner class,

private final class Innerclassname extends MTApplication

your scene class prototype should look somehow like this:

public final class Sceneclassname extends AbstractScene

and then each subdialog:

public class Subdialog extends MTRoundRectangle

Here there are some alternatives to MTRoundRectangle, it depends on what you want to get.

Profile