I have 2 jpanels, one is used as a header for another. I want to hide panel with content and move header down when clicked on header (like minimizing). I am able to hide panel, but can't change the location of another one. Here is the code:
private void dbStatsLabelMouseClicked(java.awt.event.MouseEvent evt) {
if (report1Panel.isVisible()) {
report1Panel.setVisible(false);
Point p = reportHeaderPanel.getLocation();
p.y = p.y + 100;
reportHeaderPanel.setLocation(p);
}
}