jnew                  package:rJava                  R Documentation

_C_r_e_a_t_e _a _J_a_v_a _o_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     '.jnew' create a new Java object

_U_s_a_g_e:

     .jnew(class, ..., check=TRUE, silent=!check)

_A_r_g_u_m_e_n_t_s:

   class: fully qualified class name in JNI notation (e.g.
          '"java/lang/String"').

     ...: Any parametes that will be passed to the corresponding
          constructor. The parameter types are determined automatically
          and/or taken from the 'jobjRef' object. For details see
          '.jcall'. Note that all named parameters are discarded.

   check: If set to 'TRUE' then '.jcheck' is invoked before and after
          the call to the constructor to clear any pending Java
          exceptions.

  silent: If set to 'FALSE' then '.jnew' will fail with an error if the
          object cannot be created, otherwise a null-reference is
          returned instead. In addition, this flag is also passed to
          final '.jcheck' if 'check' above is set to 'TRUE'. Note that
          the error handling also clears exceptions, so 'check=FALSE,
          silent=FALSE' is usually not a meaningful combination. 

_V_a_l_u_e:

     Returns the reference ('jobjRef') to the newly created object or
     'null'-reference (see '.jnull') if something went wrong.

_S_e_e _A_l_s_o:

     '.jcall', '.jnull'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     f <- .jnew("java/awt/Frame","Hello")
     .jcall(f,,"setVisible",TRUE)
     ## End(Not run)

