java怎么导入自己的包_java – 尝试导入我自己的包

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.

}

}

我正在创建一个游戏而且我遇到了导入问题.

如您所见,我想导入JavaGame.src.resources,因为我正在尝试导入img.

这是我的目录的立场:

1ChqH.jpg

我不需要知道resourcesmanager.java上的代码.

所以基本上,这个类在包mainClasses中,但我想访问资源包.是什么赋予了?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值