← Back to team overview

sikuli-driver team mailing list archive

[Question #248226]: enum java

 

New question #248226 on Sikuli:
https://answers.launchpad.net/sikuli/+question/248226

Hello.

I just learned the benefits of an enum in java. However, it doesn't appear that Sikuli can use string enums.

I used this:
	public enum images{
		Android_Home {
		      public String toString() {
		          return "..\\..\\" + "Images\\Android_Home.png";
		      }		
		};
		private images(){	
		}
	}

The call in my program was like this:
					Screen s = new Screen();
					try {
						s.click("..\\..\\Images\\Android_Home.png");
					} catch (FindFailed e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}

I switched it out with the enum, but it just locks up now.

However, if I do a System.out.Println(images.Android_Home); I get the location I want. 

Let me know if I'm missing something. 

Thanks.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.