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.
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.
in addition have ability create combo boxes i'd want them be, in line shown.
however, once try dynamic create both, location/positioning gets messed up.
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
Post a Comment