Netrexx Question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Netrexx Question

Quique Britto
I am using eComStation OS (OS/2) and Netrexx with Java 1.4, using the below code the compiler returns that I must use:
  mainwindow.ContentPane().setLayout() instead of mainwindow.setLayout()

Ths same code works fine under Windows using Java 1.6, is this a Java version thing or Netrexx?


import javax.swing.

class mylabel2
method main( args=String[] ) static
  mainwindow = JFrame( "JLabel Example using HTML" )
  mainwindow.setLayout( GridLayout( 1,1 ))

  -- text using HTML center alligned
  htmllabel = JLabel( "<html>line 1<p><font color=blue size=+2>big blue</font> line 2<p>line 3</html>", JLabel.CENTER )
  mainwindow.add( htmllabel )

  -- set default operation for the Frame
  mainwindow.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE )

  -- set frame size and make visible
  mainwindow.setSize( 600,100 )
  mainwindow.setVisible( 1 )

_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Netrexx Question

Patric Bechtel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quique Britto schrieb am 24.02.2010 11:56:

> I am using eComStation OS (OS/2) and Netrexx with Java 1.4, using the
> below code the compiler returns that I must use:
>   mainwindow.ContentPane().setLayout() instead of mainwindow.setLayout()
>
> Ths same code works fine under Windows using Java 1.6, is this a Java
> version thing or Netrexx?
>
>
> import javax.swing.
>
> class mylabel2
> method main( args=String[] ) static
>   mainwindow = JFrame( "JLabel Example using HTML" )
>   mainwindow.setLayout( GridLayout( 1,1 ))
>
>   -- text using HTML center alligned
>   htmllabel = JLabel( "<html>line 1<p><font color=blue size=+2>big
> blue</font> line 2<p>line 3</html>", JLabel.CENTER )
>   mainwindow.add( htmllabel )
>
>   -- set default operation for the Frame
>   mainwindow.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE )
>
>   -- set frame size and make visible
>   mainwindow.setSize( 600,100 )
>   mainwindow.setVisible( 1 )
>

That's ok. Since java 1.6, the JFrame.add method forwards the call to
getContentPane().add for convenience. Before, that wasn't the case.

- --
Patric
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: GnuPT 2.5.2

iEYEARECAAYFAkuFCZ8ACgkQfGgGu8y7ypB0HACfZnBJWQzPlvedYiYPguydStGD
8O8AoO/WPjW3S9dpO+IaUC/wSMOG0/sG
=uDx+
-----END PGP SIGNATURE-----
_______________________________________________
Ibm-netrexx mailing list
[hidden email]