Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to avaoid java.lang.IllegalArgumentException: No enum const class

912973May 17 2012 — edited May 21 2012
HI ,

Iam getting java.lang.IllegalArgumentException when iam using switch case through Enum contants.

//Enum Constants declaration
public enum USEOFPROCEEDSVALUES { U1,U2,U3, U4}




//Using Enum in Java class
Test.java

USEOFPROCEEDSVALUES useOfProceedsVar =USEOFPROCEEDSVALUES.valueOf(useOfproceeds);

switch (useOfProceedsVar) {
case U1:

revenueSourceCode="REVENUE_SOURCE_CODE.POWER";

break;
case U2:
revenueSourceCode="REVENUE _SOURCE_CODE.WATER";
break;
case U3:
revenueSourceCode="REVENUE_SOURCE_CODE.POWER";
break;
case U4:
revenueSourceCode=REVENUE_SOURCE_CODE.POWER";
}
break;
default:
revenueSourceCode=null;



Exception raising if there is either of these not U1,U2,U3,U4 ara not avalabele. i.e is if useOfProceedsVar is A6 then exception raising

How to avoid this exception

Thanks for early reply

Comments

Frank Nimphius-Oracle
what again is the question ? Don't know what you mean by "Java Wing"

Frank
Edward D.G.
Sorry, I'd like mean: "ADF: Java Swing Application"
Answer
Hi.

ADF Swing lacked good documentation for years. And now, it has been officially deprecated when ADF 11.1.2.0.0 was released. See:

http://www.oracle.com/technetwork/developer-tools/jdev/shermanrelnotes-405777.html#swing

ADF Swing will completely vanish in 12c, it seems.

Obviously, nothing prevents you to build a Swing application that will access ADF BC business logic remotely through web services, for example. However, you will not have the benefit of the Swing to EJB binding layer that ADF Swing was providing.

Best Regards,

Frédéric.
Marked as Answer by Edward D.G. · Sep 27 2020
1 - 3
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 18 2012
Added on May 17 2012
8 comments
14,888 views