Java Swing/AWT GUI Locations Wrong -


so have application developed in c# creates bunch of controls on command button click. lot of control creation i've scaled down first 2 of set creates, simplicity. in picture below you'll see have pressed create button (which goes invisible upon clicking) , made 16 (ability scroll see more) text boxes , combo boxes each respectively aligned each other.

visual studio c# form application

now, know should have thought of developing in cross platform environment before production, disregarding that, main problem emulating application in java using swing , awt gui objects.

i have ability create text boxes in line shown. java swing/awt gui text boxes

in addition have ability create combo boxes i'd want them be, in line shown. java swing/awt gui combo boxes

however, once try dynamic create both, location/positioning gets messed up.

java swing/awt gui both

is there attribute or property i'm missing? code location positioning below... don't have other attributes turned on or off different defaults.

    panelcontainer.add(newcombobox);      newcombobox.setsize(95, 20);     newcombobox.setlocation(minicount * (newcombobox.getwidth() + 10) + 80, 45 + levelcount * 170); 

    panelcontainer.add(newtextbox);      newtextbox.setsize(95, 20);     newtextbox.setlocation(minicount * (newtextbox.getwidth() + 10) + 80, levelcount * 170); 

the minicount , levelcount variables make sure have 6 (minicount) items per row , go next row if need (levelcount). rest of magic numbers positioning of course.

the text boxes awt textfields boxes. combo boxes awt choice boxes.

edit: java application , c# application separate. run same algorithm, i'm have trouble making guis act same.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -