JOptionPane 的 setSize [英] setSize of JOptionPane

查看:34
本文介绍了JOptionPane 的 setSize的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试设置 JOptionPane 的大小,但它坚持相同的大小.我已经尝试过 setPreferredSize 和 setSize 但由于某种原因 JOptionPane 坚持相同的宽度和高度.基本上我有一堆文本,并且由于窗口的大小而被切断".

Trying to set size of a JOptionPane but it's sticking with the same size. I've tried setPreferredSize and setSize but for some reason the JOptionPane is sticking with the same width and height. Basically I have a bunch of text and it's being "cut off" because of the size of the window.

我实际上正在使用另一种语言的 Swing 库的一个端口,所以这可能是他们的库的一个错误 - 但根据文档,它应该反映 Java Swing 调用.

I'm actually using a port of the swing library in another language, so it could be a bug with their library - but according to the docs it should mirror the Java Swing calls.

我错过了什么吗?

  • edit - 想补充一点,我使用 JOptionPane.showInputDialog 创建了 joptionpane

  • edit - wanted to add that I create the joptionpane with JOptionPane.showInputDialog

再次编辑 - 我正在使用 ASwing(Java Swing 的动作脚本端口 - 因此可能存在 api 差异,尽管它应该是一个端口...)

edit again - i'm using ASwing (actionscript port of Java Swing - hence there might be api differences though it's supposed to be a port...)

推荐答案

实际上,找到了修复.移植的库构建了 JOptionPane 我猜与 Java 版本略有不同.

Actually, found the fix. The ported library built the JOptionPane I guess slightly different than the Java version.

optionpane.getFrame().setSize()

(使用 ASwing - Java Swing 的 Actionscript 端口)

(using ASwing - Actionscript port of Java Swing)

这篇关于JOptionPane 的 setSize的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆