0

I'm currently working on a small project that requires "null" layout of my JPanel.

When adding or editing a JTextField, is there any other way for me to have it visible without having to setBounds()? What I want is for the height and width to be determined by the text size, and for me to set only the location of the text in my JPanel.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • 1
    *"is there any other way for me to have it visible without having to setBounds()"* - No - that's what layout managers do. If you "must" deal without layout managers, then **you must** replace it's functionality. I can't begin to tell you what a really (I'm restraining my language at this point) decision it is to NOT use layout managers - this will be your single greatest work load – MadProgrammer Apr 23 '18 at 20:32
  • *"I'm currently working on a small project that requires "null" layout of my `JPanel`."* .. ***Why?*** – Andrew Thompson Apr 23 '18 at 23:55

1 Answers1

0

If you want to set it to the default layout, do setLayout(new BorderLayout());

Raymo111
  • 514
  • 8
  • 24