Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert the .place() method in python to java?

I am trying to convert my Python Code to Java. I need a GUI that is similar to python where I can use widgetname.place(x,y) to place objects anywhere I want in the window. I want to be able to specify where the object is placed in the window. I have tried GridLayout, GridBagLayout, BoxLayout and FlowLayout. None of those are allowing me to secify x and y coordinates to place my objects(text fields, labels, buttons) where ever I want. I need to be able to specify where the object goes on the screen using x and y coordinates.

Anyone have any ideas?

like image 519
Josh Menzel Avatar asked Sep 16 '25 01:09

Josh Menzel


1 Answers

This can be done setting your LayoutManager to null, but it's highly discouraged precisely because it annihilates the goal of layouts, which is to be able to have good-looking frames, regardless of the look and feel, screen resolution, etc.

You'd better learn how to use layout managers, because that's the good way to design a GUI.

like image 107
JB Nizet Avatar answered Sep 17 '25 15:09

JB Nizet