1
private void PersonalInfoJButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                    

    JPanel createUserJPanel =new CreateUserJPanel(user);
    JSplitPane.setRightComponent(createUserJPanel);

}

它向我显示错误,例如non-static method cannot be reffered to static component

如何在正确的组件上显示我的 jframe?

4

2 回答 2

0

由于setRightComponent() 不是一个static方法,它告诉创建一个instance来使用它method

喜欢

final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setRightComponent(createUserJPanel);
于 2013-09-10T16:34:05.020 回答
0

您需要创建一个 JSplitPane 的实例:

JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setRightComponent(createUserJPanel);
于 2013-09-10T16:36:40.723 回答