package mainClasses;
/*
* Frame Info and all that ****,
* mainFrame is the actual frame itself
* it will refer to MainC.java a lot Main class = Main Class
*/
import java.awt.FlowLayout;
import java.awt.Graphics;
import JavaGame.src.resources.*; //Problem Code
import javax.swing.JButton;
import javax.swing.JFrame;
public class mainFrame extends JFrame {
private static final long serialVersionUID = 1L;
public mainFrame() {
JButton playButton = new JButton();
JButton infoButton = new JButton();
JButton exitButton = new JButton();
int x = 300, y = 300;
setSize(x, y);
setVisible(true);
setLayout(new FlowLayout());
setTitle("Kingdom Raider");
setDefaultCloseOperation(EXIT_ON_CLOSE);
/*Buttons and Properties*/
playButton.setBounds(x, y, 200, 100);
playButton.setText("Play!");
add(playButton);
infoButton.setBounds(x, y, 200, 100);
infoButton.setText("Information");
add(infoButton);
exitButton.setBounds(x, y, 200, 100);
exitButton.setText("Exit");
add(exitButton);
/* Add image here */
}
public void Painting (Graphics g) {
//Me.
}
}
私はゲームを作成していますが、インポートに問題があります。 私はimgをインポートしようとしているので、私はJavaGame.src.resourcesをインポートしたいと思う。自分のパッケージをインポートしようとしています
私は、現時点ではresourcesmanager.javaその空白のコードを知っている必要はありません。ここに は私のディレクトリが立っている方法です。 基本的に、このクラスはmainClassesパッケージにありますが、私はリソースパッケージにアクセスしたいです。何がありますか?
パッケージ名は 'resources'だけです、' src'フォルダと 'JavaGame'フォルダは含まれていません –