-7

Expect null layout any other suggestion? Any suggestion would be appreciate!

*Actually this post I already don't need already, how can I remove it?

kit
  • 1,166
  • 5
  • 16
  • 23
  • Use existing layouts ? Here [A Visual Guide to Layout Managers](https://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html) – AxelH Apr 12 '18 at 09:00
  • 1
    What should you do? That depends on what you're trying to do. The question is so broad as to be simply unanswerable. There are lots of things you could do. You could use [compounding layouts](https://stackoverflow.com/questions/33576358/how-to-use-java-swing-layout-manager-to-make-this-gui/33577874#33577874), where you make use of a number of different layout managers to generate complex layouts, [for example](https://stackoverflow.com/questions/21618866/adding-a-jlabel-in-relative-position-to-buttons/21619545#21619545) – MadProgrammer Apr 12 '18 at 09:12
  • @WeiJieLoo with the NullLayout, you would have to set the size of each componenent (and it's location) based on pixels. It'll look just fine. As long as those using your code are using the same screen resolution as you are. – Stultuske Apr 12 '18 at 09:12
  • Or, if you problem is suitably complex, you might try using your own [custom layout manager](https://stackoverflow.com/questions/24622279/laying-out-a-keyboard-in-swing/24625704#24625704), although I'd be the suggestion to look at some of the other layouts which are around, like MigLayout for example – MadProgrammer Apr 12 '18 at 09:15
  • @Stultuske *"It'll look just fine"* - never meet a absolute layout that did – MadProgrammer Apr 12 '18 at 09:15
  • Or even [something like these](https://stackoverflow.com/questions/11819669/absolute-positioning-graphic-jpanel-inside-jframe-blocked-by-blank-sections/11822601#11822601) – MadProgrammer Apr 12 '18 at 09:19
  • [You can even randomise the layout](https://stackoverflow.com/questions/27974966/moving-jpasswordfield-to-absolute-position/27975101#27975101) ;) – MadProgrammer Apr 12 '18 at 09:21

1 Answers1

-3

One solution would be to implement your own LayoutManager (or use or extend an existing one, if one is really close to your needs) using the features and controls you are looking for. Your absolute positioning requirements would simply become a method of your layout manager.

J. Lorenzo
  • 151
  • 1
  • 7