java - Two Components on top of each other using MigLayout -


i'm trying 2 components,

    frame.getcontentpane().setlayout(new miglayout("", "[53px,grow][57px][grow]", "[23px][][][]"));      jtextpane itemtitle = new jtextpane();     frame.getcontentpane().add(itemtitle,"cell 0 4,alignx left,aligny top");     itemtitle.setvisible(true);     itemtitle.setminimumsize(new dimension(50, 50));      list choices = new list();     frame.add(choices, "cell 0 4,alignx left,aligny top");     choices.setvisible(true); 

to in same place, happens this:

https://i.imgur.com/0o9a8tk.png

the 2 components highlighted @ itemtitle , choices. aim have buttons above set 1 "setvisible" true , other false. never both true. how can 2 components in 1 cell @ same time? puts above buttons out of place , i'm not sure why. put above important code referring 2 components, put full gui code if requested.

i found this: fill entire cell 2 components using miglayout on years old , honest, don't understand solution. i'm sort of learning go, i've never used miglayout before. should using different layout?

thanks

to in same place... aim have buttons above set 1 "setvisible" true , other false. never both true

then should using jpanel contains 2 components. use card layout on panel , use cardlayout determine component visible @ given time. panel can added panel using miglayout other component.

list choices = new list(); 

looks me using awt component. should using jlist swing application.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -