我是代码名称的新手.我必须在具有特定宽度和高度的容器(流布局)中添加图像.
1:codenameone的指南说我们必须在资源文件夹中添加图像.资源文件夹在哪里?
2:要创建图像我正在使用图像类的createImage(path).如果我们将图像文件放在资源文件夹中,那么该图像的路径是什么.
3:这里有图像文件的任何类型限制.
请帮忙.
我想在调用方法时显示编译时错误.
就像我有一个"MyClass"类,其中有两个方法"methodA()"和"methodB()".现在我创建一个"MyClass"的实例.使用这个实例我可以调用这两个方法,但如果我在"methodA()"之前调用"methodB()",我需要显示编译时错误; 强文
class MyClasss
{
public void methodA()
{
//do some thing
}
public void methodB()
{
//do some thing
}
}
class MyRunningClasss
{
public static void main(String... args)
{
MyClass MC = new MyClass();
// it will not give any compile time error.
MC.methodA();
MC.methodB();
// but it have to give compile time error.
MC.methodB();
MC.methodA();
}
}
Run Code Online (Sandbox Code Playgroud)