Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2007

Tip: Looking for answers? Try searching our database.

Problem with texture of UI

Thread view: 
stacey - 21 Jan 2007 10:50 GMT
Hello everyone,

I have the following problem.
I am making a java application, and i have several call to Matlab
functions.
Maybe you dont know it, but in Matlab 7.3 there is a java compiler so
you can make java code out of Matlab code.

When i call those functions, the texture of the buttons and everything
messes up. It dissapears!
E.g. The buttons before the call have a sort of texture.., after the
call , ther are just simple square shapes, like if you take a pencil
and draw them yourselves.

This happens in jRadioButtons as well, and in pop up messages. In pop
up messages the letter lose their boldness..
I can print screen them if you want.

I haven't got any clue why this is happening.
I haven't touched the look&Feel.

Any suggestions/ideas??

Thank you very much.

Stavroula
Larry Barowski - 21 Jan 2007 11:06 GMT
> Hello everyone,
>
[quoted text clipped - 18 lines]
>
> Any suggestions/ideas??

For a start, you could print out UIManager.getLookAndFeel() to
see if the Matlab code is changing it. I would suspect that some
static initializer is setting a "Matlab Look & Feel".
stacey - 21 Jan 2007 14:05 GMT
I get the UIManaget.getLookAndFeel() printed before the matlab call and
after and i get:

before: [The Java(tm) Look and Feel -
javax.swing.plaf.metal.MetalLookAndFeel]
after: [The Microsoft Windows Look and Feel -
com.sun.java.swing.plaf.windows.WindowsLookAndFeel]

So it doesnt change. Great! Thanx!
I used the UIManager.setLookAndFeel function to reset it.

But a problem still exists. While matlab is called the look & feel
disappears, and you can see it in the application, and after the
function is done, i set it again and everything is ok.

I dont know if there is any ways to change this..or if you know..
because i cannot alter Matlab's java compiled code.
but thank you because it works much better now!

Regards,

Stavroula

On Jan 21, 1:06 pm, "Larry Barowski"
<MElarrybar-AT-eng_DOT_auburnANOTHERDOTeduEND> wrote:

> > Hello everyone,
>
[quoted text clipped - 20 lines]
> see if the Matlab code is changing it. I would suspect that some
> static initializer is setting a "Matlab Look & Feel".
stacey - 21 Jan 2007 16:07 GMT
Ok.. I just found another thing..

I reset the Look and Feel after every matlab call, ok?
The buttons and RadioButtons seem ok after matlab is called. their
texture is restored. But the pop up windows and the file choosers have
a bit changed after i call matlab for the first time... their letters
are not bold as they used to.

Any ideas?

Thanx again

Regards,
Stavroula

> I get the UIManaget.getLookAndFeel() printed before the matlab call and
> after and i get:
[quoted text clipped - 47 lines]
> > see if the Matlab code is changing it. I would suspect that some
> > static initializer is setting a "Matlab Look & Feel".
Larry Barowski - 21 Jan 2007 21:08 GMT
> Ok.. I just found another thing..
>
[quoted text clipped - 3 lines]
> a bit changed after i call matlab for the first time... their letters
> are not bold as they used to.

Changing the Look & Feel after components are
visible is not that simple. You have to update all
of the UI, which could be easy or difficult
depending on your application. Anyway, you
certainly don't want to be resetting the L&F
after every Matlab call. What interface are you
using to access Matlab from Java? Are there any
L&F specific commands?
stacey - 22 Jan 2007 20:25 GMT
All the buttons are updated apart from the letters in pop ups, as
mentioned above.

What do you mean " What interface am i using to access Matlab from
Java??"

I am doing the following procedure:
1) I write a function in matlab code and i use the matlab javabuilder
to compile it and make it into a java package wich contains this
function, with a specific API.
2) Then insert the package into my java application and i create an
instance of the class and i call its method which is the function i
wrote. if  i want to pass numeric arguments, i have to declare them in
type: MWNumericArray.
Thats it. actually.

I dont use any L&F coommands.. as far as i know. I dont know what
matlab does, i have no tutorial for Java builder. I have asked in
matlab groups, but havent got any answer.

Thank you again,

Stavroula

On Jan 21, 11:08 pm, "Larry Barowski"
<MElarrybar-AT-eng_DOT_auburnANOTHERDOTeduEND> wrote:

> > Ok.. I just found another thing..
>
[quoted text clipped - 10 lines]
> using to access Matlab from Java? Are there any
> L&F specific commands?
Larry Barowski - 23 Jan 2007 15:36 GMT
> I am doing the following procedure:
> 1) I write a function in matlab code and i use the matlab javabuilder
[quoted text clipped - 9 lines]
> matlab does, i have no tutorial for Java builder. I have asked in
> matlab groups, but havent got any answer.

I can't find anything about Look&Feel in their online docs.
Since it seems they are using the system L&F, you could
just call a Matlab method before you create any interface
and stick with that, until you find a better solution. At least
that way you won't have components with different L&Fs
mixed up in your application.
stacey - 27 Jan 2007 16:55 GMT
Thanx a lot for your help.

I ll do what you proposed. Its a good temp solution..

Best Regards,

Stacey

On Jan 23, 5:36 pm, "Larry Barowski" <MElarrybar-AT-
eng_DOT_auburnANOTHERDOTeduEND> wrote:

> > I am doing the following procedure:
> > 1) I write a function in matlab code and i use the matlab javabuilder
[quoted text clipped - 14 lines]
> that way you won't have components with different L&Fs
> mixed up in your application.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.