简体   繁体   中英

Creating another window for just displaying text + swing

I currently have a window frame with panels inside and am using it to run my program. Now I am in a need to display text along with running of the code side by side.

The problem with displaying it in the same window is that it minimizes the total screen area which I am using for input handling.

Thus I decided to create a dialog box and dump all the text inside.

This proved to be a bad decision as sometimes the output is really large and dialog boxes do not contain the scroll bar.

Can anyone tell me what's the best way to proceed?

I just want suggestions to what should I try and do not need any code part for it as I would like to do that on my own :)

You should follow tradition and use either:

  • One JFrame that will host your application and open any number of JDialog s your for your scrolling text etc.

or

  • One JFrame with any number of JInternalPane s.

JFrame is a top-level container and every application should have only one. You do not loose any functionality this way, and you stick with the standards, which will definitely make somebody's life easier in the future. Maybe your's.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM