Im a bit confused why this code only shows panel 2 and not panel 1.
If i try just removing panel2 (pnl2), pnl1 will show, but when put together its only pnl2 that is showing.Code:container = frame.getContentPane(); SpringLayout sl = new SpringLayout(); container.add(pnl1); container.add(pnl2); sl.putConstraint(SpringLayout.WEST, pnl1, 5, SpringLayout.WEST, this); sl.putConstraint(SpringLayout.NORTH, pnl1, 5, SpringLayout.NORTH, this); sl.putConstraint(SpringLayout.WEST, pnl2, 5, SpringLayout.EAST, pnl1); sl.putConstraint(SpringLayout.NORTH, pnl2, 5, SpringLayout.SOUTH, pnl1);
Ive also tried this for pnl2
but still no luckCode:layout.putConstraint (SpringLayout.WEST, pnl2, 10, SpringLayout.WEST, this); layout.putConstraint (SpringLayout.NORTH, pnl2, 5, SpringLayout.SOUTH, pnl1);![]()





Reply With Quote