Simina Alin
Simina Alin

Reputation: 133

New window inside a main window?

I am a beginner and I am trying to make a text editor and I want to create a pop up window for text format when I press a menu button where I can put all things like font face, font size , font style etc. Can you tell me how I can make this new window? Thanks for your patience!

For example Notepad:

enter image description here

Upvotes: 1

Views: 91

Answers (2)

user2693587
user2693587

Reputation:

You can simply create a brand spanking new JFrame and it will still be counted as the same application.

Tip: Use Eclipse Window Builder

Upvotes: 0

MadProgrammer
MadProgrammer

Reputation: 347244

I think what you're after is a dialog of some kind.

Take a look at How to Make Dialogs for more details.

What I would do is design the basic UI onto a JPanel. I would then add this JPanel to an instance of a JDialog (possibly even using a JOptionPane) and show this dialog, making sure to make it modal, so you can easily retrieve the values set by the user.

This means that you can decide how best to show the user interface or even show it in a number of different ways as it's not constrained to a single top level container

Upvotes: 4

Related Questions