![](/img/trans.png)
[英]How to display an image that a user has selected on the JFrame using JavaSwing
[英]how can I display my jframe on right component using javaSwing?
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
類的錯誤non-static method cannot be reffered to static component
如何在正確的組件上顯示我的jframe?
由於setRightComponent()不是static
方法,因此要創建一個instance
以使用該method
。
喜歡
final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setRightComponent(createUserJPanel);
您需要創建一個JSplitPane的實例:
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
splitPane.setRightComponent(createUserJPanel);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.