Archived

This topic is now archived and is closed to further replies.

Rickmeister

[java] a bit of help here..please

Recommended Posts

Rickmeister    182
I''m taking a course in OOP and there we''re using Java, and we''ve got an assignment to implement a simple kind of database editor with a full GUI using swing/AWT components. I''ve pretty much figured the whole thing out, but one thing keeps bugging me - how do I detect that the window (JFrame) has been resized by the user? I know how to do it with the Win32 API in C/C++, so it makes it even more frustrating... An easy way is to set setResizable(false), but personally I hate windows that don''t allow me to resize them to fit on my desktop Tried the online docs but no luck there, Sun has really succeeded to hide away some information and my books don''t have anything to tell me. Guess that it has something to do with HierarchyListener or HierarchyBoundsListener but I can''t get it to work properly (infact, it doesn''t work at all..) Too tired to try once more... gotta go to bed...zzz Wannabe warning C4786: identifier was truncated to ''255'' characters in the debug information Test.exe - 0 error(s), 76 warning(s)

Share this post


Link to post
Share on other sites
HenryApe    120
The java.awt.event.ComponentListener class has a componentResized method and JFrame has an addComponentListener method since it inherits java.awt.Component.

Share this post


Link to post
Share on other sites
Rickmeister    182
Thanks... I sortof already had the solution, but didn''t know how to use it... Works great now.. Gotta learn me more about Java, kinda cool language..

Wannabe
warning C4786: identifier was truncated to ''255'' characters in the debug information
Test.exe - 0 error(s), 76 warning(s)

Share this post


Link to post
Share on other sites