如何在 JOptionPane 上添加文本区域 [英] How to add text area on JOptionPane

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

问题描述

目前我有一个 JOptionPane.单击按钮时,我正在执行以下行.

Currently I have a JOptionPane. On clicking a button I am executing following line.

JOptionPane.showInputDialog(this,"Enter your message","Messages",2);

它会打开一个带有文本框的弹出窗口.此文本框接受大约 40/50 个字符.事实上,我的要求是在此文本框中接收长消息(最多 300 个字符),这将阻止此操作.所以我们想在这个输入对话框上想出一个文本区域?有可能吗?有没有更好的解决办法?提前致谢.

It opens a popup with a text box. This text box accepts around 40/50 characters. In fact my requirement is to take long message (upto 300 characters) in this text box which is stopping this. So we want to come up with a text area on this input dialog? Is it possible how? Is there any better solution? Thanks in advance.

推荐答案

官方教程 包含示例,另一个示例这里

official tutorial contains example for that, another examples here

这篇关于如何在 JOptionPane 上添加文本区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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