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?
答案 0 :(得分:0)
由于setRightComponent()不是static
方法,因此建议使用instance
创建method
。
像
final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setRightComponent(createUserJPanel);
答案 1 :(得分:0)
您需要创建JSplitPane的实例:
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setRightComponent(createUserJPanel);