Learn more about how Javonet works and its benefits, and check out our customers and their success stories.
Resources for Java developers who want to use .NET libraries in their projects.
Resources for .NET developers who want to use Java JARs in their projects.
- TRY FREE
APIs for Java DevelopersGo to APIs for .NET Developers
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<JavonetApartmentState>
public enum JavonetApartmentState extends java.lang.Enum<JavonetApartmentState>Enum that specifies possible apartments states to be used for main thread
initialized on .NET side.
Javonet during initialization creates .NET process connected to JAVA process of your
application. The .NET process main thread can be in Multi-Threaded Apartment state
or Single-Threaded Apartment state. This value is very important for implementations
where WinForms or WPF interface is supposed to be used for JAVA application.
In case when you plan to create WinForms or WPF interface you must use STA apartment thread.
Important: STA mode is supported only in .NET Framework 4.0 or 4.5 mode. For .NET 3.5 DLLs
which require STA mode please load .NET Framework 4.0 or higher.
Apartment state must be set before any other Javonet operation is called. It can be specified
Javonet.setApartmentState(JavonetApartmentState)method or using Javonet
XML configuration file; for example
<?xml version="1.0" encoding="ISO-8859-1" ?> <javonet> <activation> <email>email@example.com</email> <licencekey>your-javonet-license-key</licencekey> </activation> <references> <reference>System.Windows.Forms</reference> <reference>System.Drawing</reference> </references> <settings> <apartmentState>STA</apartmentState> <framework>v35</framework> </settings> </javonet>
Enum Constant Summary
Enum Constants Enum Constant and Description
MTAThe Thread will create and enter a multi-threaded apartment.
STAThe Thread will create and enter a single-threaded apartment.
All Methods Static Methods Concrete Methods Modifier and Type Method and Description
valueOf(java.lang.String name)Returns the enum constant of this type with the specified name.
values()Returns an array containing the constants of this enum type, in
the order they are declared.
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Enum Constant Detail
public static final JavonetApartmentState MTAThe Thread will create and enter a multi-threaded apartment.
public static final JavonetApartmentState STAThe Thread will create and enter a single-threaded apartment.
public static JavonetApartmentState valueOf(java.lang.String name)Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
name– the name of the enum constant to be returned.
- the enum constant with the specified name
java.lang.IllegalArgumentException– if this enum type has no constant with the specified name
java.lang.NullPointerException– if the argument is null
public static JavonetApartmentState values()Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (JavonetApartmentState c : JavonetApartmentState.values()) System.out.println(c);
- an array containing the constants of this enum type, in the order they are declared