I 같은 핸드 커서를 요구 JLabel의 단추의 범위 갖는 다층 Java 애플리케이션이 커서 그러나자바의 JLayeredPane 재정
button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
을 그 위에 층을 경계 전체를 덮고있다 가지고 응용 프로그램 (팝업 등 그리기). 위의 레이어를 추가 했으므로 커서가 더 이상 변경되지 않습니다. 위의 레이어에 대해 커서를 null로 설정하려고 시도했지만 영향이 없습니다.
private void create() {
this.addWindowListener(windowAdapter);
this.setLayout(new BorderLayout());
layers = new JLayeredPane();
layers.setPreferredSize(this.getSize());
dashboard = new DashBoard.DashBoardLayer();
dashboard.setBounds(0, this.getHeight()-275, this.getWidth(),275);
application = new App.ApplicationLayer();
application.setBounds(0,0,this.getWidth(),this.getHeight()-145);
filter = new FilterLayer();
filter.setBounds(0,195,this.getWidth(),490);
menuBG = MenuLayerBg.getInstance();
menuBG.setBounds(0,0,this.getWidth(),this.getHeight());
menuPanes = MenuLayer.getInstance();
menuPanes.setBounds(0,0,this.getWidth(),this.getHeight());
layers.add(application, new Integer(0));
layers.add(filter, new Integer(1));
layers.add(dashboard, new Integer(2));
layers.add(menuBG, new Integer(3));
layers.add(menuPanes, new Integer(4));
this.add(layers, BorderLayout.CENTER);
}
내가 끝이 잘 작동에 당신이 언급 한 것처럼 편집이 (가) 레이어 기능이 포함되어 있음을 발견했다. 오버레이 레이어가 false를 반환하면 하위 레이어가 커서를 표현할 수 없게되어서 감사합니다! – kmac