mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-09-01 02:29:03 +00:00
respect screen size when displaying dialog
This commit is contained in:
parent
0386dbaf44
commit
ca8d0905c8
@ -26,7 +26,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ProjectDirectoriesDialog.java,v 1.8 2008/10/03 10:26:16 fros4943 Exp $
|
||||
* $Id: ProjectDirectoriesDialog.java,v 1.9 2008/10/03 13:46:30 fros4943 Exp $
|
||||
*/
|
||||
|
||||
package se.sics.cooja.dialogs;
|
||||
@ -588,6 +588,16 @@ class ConfigViewer extends JDialog {
|
||||
contentPane.add(buttonPane, BorderLayout.SOUTH);
|
||||
|
||||
pack();
|
||||
|
||||
/* Respect screen size */
|
||||
Rectangle maxSize = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
|
||||
if (maxSize != null && (getSize().width > maxSize.width)) {
|
||||
setSize(maxSize.width, getSize().height);
|
||||
}
|
||||
if (maxSize != null && (getSize().height > maxSize.height)) {
|
||||
setSize(getSize().width, maxSize.height);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user