Oh, I see now.
There is 2 different programs there. The firs is Kermit's and goes from then line: -- -------------------------------- NetRexx GUI sample code --------------------------------------- to the line before: /* some notes removed here */ The rest is my own version of the program. Since you put both together into a single source file, you get the duplicate function error. Try each one in its own and they'll work. --- Saludos / Kind regards. David Requena El 06/10/2010 12:53, Robert Hamilton escribió:
_______________________________________________ Ibm-netrexx mailing list [hidden email] |
i TRIED with each commented out; I'll give it another try.
I really think NetRexx is worth the time. I have two 'County' Colleges and one Large private University interested but I have nothing really to show them. That's why I'm interested in the NetRexx/JAVA project. Thanks for the time and Enjoy the Day, Evening -- whatever. BobH On Wed, Oct 6, 2010 at 6:14 AM, David Requena <[hidden email]> wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] |
In reply to this post by David Requena
-- This code import javax.swing. class guisample public implements ActionListener properties inheritable static frame = JFrame textfield = JTextField method main(sa=String[]) static -- build a gui and die.. guisample() method guisample -- GUI objects must be instantiated from EDT so -- tell it to do so SwingUtilities.InvokeLater(this.guiBuilder()) method actionPerformed(e=ActionEvent) -- safe here as event handling code is called from EDT say textfield.getText frame.dispose frame=null class guisample.guiBuilder dependent implements Runnable -- SwingUtilities.InvokeLater requires a Runnable so we need -- a separate class :-( method run parent.frame=JFrame("Sample GUI window") parent.frame.setSize(400,100) panel=JPanel() parent.frame.add(panel) parent.textfield=JTextField("Some default text here") panel.add(parent.textfield) button=JButton("OK") button.addActionListener(parent) panel.add(button) parent.frame.setVisible(1) -- Saludos / Kind regards. David Requena -- gives this result /* [C:\Program Files\jEdit\guisample.nrx 94 8 9] Error: 'Class guisample' instruction has already been implied for this program Program index.nrx Program multi.nrx Program asktest.nrx Program test.nrx Program testbin.nrx === class testbin === function main(String[]) Program iosample.nrx */ -- in jEdit Script; FILE name is guisample.nrx bobh _______________________________________________ Ibm-netrexx mailing list [hidden email] |
In reply to this post by Robert L Hamilton
Second try on this . . .
-- This code import javax.swing. class guisample public implements ActionListener properties inheritable static frame = JFrame textfield = JTextField method main(sa=String[]) static -- build a gui and die.. guisample() method guisample -- GUI objects must be instantiated from EDT so -- tell it to do so SwingUtilities.InvokeLater(this.guiBuilder()) method actionPerformed(e=ActionEvent) -- safe here as event handling code is called from EDT say textfield.getText frame.dispose frame=null class guisample.guiBuilder dependent implements Runnable -- SwingUtilities.InvokeLater requires a Runnable so we need -- a separate class :-( method run parent.frame=JFrame("Sample GUI window") parent.frame.setSize(400,100) panel=JPanel() parent.frame.add(panel) parent.textfield=JTextField("Some default text here") panel.add(parent.textfield) button=JButton("OK") button.addActionListener(parent) panel.add(button) parent.frame.setVisible(1) -- Saludos / Kind regards. David Requena -- gives this result /* [C:\Program Files\jEdit\guisample.nrx 94 8 9] Error: 'Class guisample' instruction has already been implied for this program Program index.nrx Program multi.nrx Program asktest.nrx Program test.nrx Program testbin.nrx === class testbin === function main(String[]) Program iosample.nrx */ -- in jEdit Script; FILE name is guisample.nrx _______________________________________________ Ibm-netrexx mailing list [hidden email] |
Bob,
OK, I'm now able to reproduce the problem. Kermit will give you the details but there is an option in NetrexxScript to define if certain internal jEdit variables should be auto-included. When it is selected the line "import javax.swing." must be the very first in your program or you get that error. So I see 2 possible solutions: - Delete any comment lines and have the import line as the first one. - Go to menu Plugins --> Plugin Options... then select NetrexxScript on left pane and then uncheck the checkbox labeled "add jEdit variables to all scripts" --- Saludos / Kind regards. David Requena El 06/10/2010 14:16, Robert Hamilton escribió: Second try on this . . . _______________________________________________ Ibm-netrexx mailing list [hidden email] |
OK; got it working . . .
thnx bobh _______________________________________________ Ibm-netrexx mailing list [hidden email] |
In reply to this post by Robert L Hamilton
"prefix" is described in the help document for NetRexxScript which is in the jEdit Help option. It adds a code prefix to your NetRexx programs which is useful for writing jEdit macro scripts but sometimes it interferes with standalone programs such as are being discussed here. To get rid of it do this: Select "Plugins" from the jEdit menu bar. Select "Plugin Options" from the Plugins menu. Select NetRexxScript from the list of installed plugins. Remove the check mark from the boxes labeled "preparse all scripts" and "add jEdit variables to all scripts". Click the "OK" button. That should make these programs run better. If you don't want to turn off the prefixing, you can just make sure that the first line in the program file is an "import" instruction or a "class" instruction to automatically override it. -- Kermit On 10/6/2010 3:53 AM, Robert Hamilton wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] |
Kermit: thanx -- I'm trying to figure out how to display the date instead of the literal.
bobh _______________________________________________ Ibm-netrexx mailing list [hidden email] |
In reply to this post by Fernando Cassia-2
Mensys is proving the bulk of the funding.
The netlabs.org project to port Java to OS/2 has released (10/1/2010) a build of OpenJDK 1.6.0-b19. This alpha release of the SDK can only compile and run console Java applications, as the GUI classes (AWT and Swing) are not yet available. Funding is being provided by Mensys and other interested parties. It uses the Odin32 runtime libraries; a GA release is scheduled for the end of the year. http://svn.netlabs.org/java Quique On 6 October 2010 00:21, Fernando Cassia <[hidden email]> wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] |
In reply to this post by Robert L Hamilton
Bob ;
Try changing this line: textfield=JTextField("Some default text here") -- create a spot for some text to this line: textfield=JTextField(Date().toString) -- create a spot for some text -- Kermit On 10/6/2010 7:26 AM, Robert Hamilton wrote: > Kermit: thanx -- I'm trying to figure out how to display the date > instead of the literal. > > bobh _______________________________________________ Ibm-netrexx mailing list [hidden email] |
Great; thnx.
Now if JAVA had a Parse??? Can I switch over to NetRexx and parse the Date().toString; lemyc bobh On Wed, Oct 6, 2010 at 12:20 PM, Kermit Kiser <[hidden email]> wrote: Bob ; _______________________________________________ Ibm-netrexx mailing list [hidden email] |
SimpleDataFormat comes handy :
fmt = SimpleDateFormat("yyyy-MM-dd HH:mm:ss") timestamp = fmt.format(Date(time)) Marc mailto:mremes@...
Great; thnx. Now if JAVA had a Parse??? Can I switch over to NetRexx and parse the Date().toString; lemyc bobh On Wed, Oct 6, 2010 at 12:20 PM, Kermit Kiser <infire@...> wrote: Bob ; Try changing this line: textfield=JTextField("Some default text here") -- create a spot for some text to this line: textfield=JTextField(Date().toString) -- create a spot for some text -- Kermit On 10/6/2010 7:26 AM, Robert Hamilton wrote: Kermit: thanx -- I'm trying to figure out how to display the date instead of the literal. bobh _______________________________________________ Ibm-netrexx mailing list [hidden email] _______________________________________________ Ibm-netrexx mailing list [hidden email] Tenzij hierboven anders aangegeven: / Sauf indication contraire ci-dessus: / Unless otherwise stated above: International Business Machines of Belgium sprl / bvba Siège social / Maatschappelijke zetel: Avenue du Bourget 42 Bourgetlaan, B-1130 Bruxelles/Brussel N° d'entreprise / Ondernemingsnr: TVA / BTW BE 0405 912 336 RPM Bruxelles / RPR Brussel _______________________________________________ Ibm-netrexx mailing list [hidden email] smime.p7s (12K) Download Attachment |
In reply to this post by Robert L Hamilton
Java does have a "parse" - it's called NetRexx! ;-)
But seriously, you have lots of options - you could use NetRexx parse to get a format you like: parse Date().toString a b c d e f textfield=JTextField(b c f) -- create a spot for some text Or you could just use a Java date formatter if you don't mind looking at some Java docs: textfield=JTextField(SimpleDateFormat("MMM. d, yyyy").format(Date())) -- create a spot for some text -- Kermit On 10/6/2010 11:01 AM, Robert Hamilton wrote: Great; thnx. _______________________________________________ Ibm-netrexx mailing list [hidden email] |
On Wed, Oct 6, 2010 at 2:21 PM, Kermit Kiser <[hidden email]> wrote:
> Java does have a "parse" - it's called NetRexx! ;-) > > But seriously, you have lots of options - you could use NetRexx parse to get > a format you like: > > parse Date().toString a b c d e f > textfield=JTextField(b c f) -- create a spot for some text > > Or you could just use a Java date formatter if you don't mind looking at > some Java docs: > > textfield=JTextField(SimpleDateFormat("MMM. d, yyyy").format(Date())) > -- create a spot for some text Or, an even better solution is to not parse the data at all. The Date and Gregorian calendar classes have methods for retrieving each of the values of a date without requiring the whole thing be formatted as a string first. Rick > > -- Kermit > > > On 10/6/2010 11:01 AM, Robert Hamilton wrote: > > Great; thnx. > > Now if JAVA had a Parse??? Can I switch over to NetRexx and parse the > Date().toString; lemyc > > bobh > > > > On Wed, Oct 6, 2010 at 12:20 PM, Kermit Kiser <[hidden email]> > wrote: >> >> Bob ; >> >> Try changing this line: >> >> textfield=JTextField("Some default text here") -- create a spot >> for some text >> >> to this line: >> >> textfield=JTextField(Date().toString) -- create a spot for >> some text >> >> >> -- Kermit >> >> On 10/6/2010 7:26 AM, Robert Hamilton wrote: >>> >>> Kermit: thanx -- I'm trying to figure out how to display the date instead >>> of the literal. >>> >>> bobh >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> > > ________________________________ > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > > _______________________________________________ Ibm-netrexx mailing list [hidden email] |
In reply to this post by David Requena
Am Dienstag, 5. Oktober 2010, 16:31:27 schrieb David Requena:
> El 05/10/2010 2:22, George Hovey escribió: > > Hope David Requena weighs in on this - I think he is pretty GUI aware. > > While that might be true, I've to say it'd be more out of sheer > stubbornness in tackling hard challenges than out of any practical > matter :-) > Non-trivial GUIs are not easy to make from NetRexx nor from java itself. > > FWIW the only reasonable way to do this is by taking advantage of the > fact that java classes and NetRexx's own are the very same thing. > So my advice is: do use NetBeans' wonderful point & click tools to make > your GUI, compile it, and then drive it from your NetRexx program. > Use your time to do more interesting things with NetRexx :-) > I think René is also using this approach in his projects. See > http://www.rexxla.org/events/2004/renej.pdf With the help of Quique's "HowTo" I've been able start with a GUI. It came out as a nice example to learn a lot about java, using java classes from NetRexx and to read javadocs the other way round. I do have some working code, but it's a eak GUI - e.g. it doesn't play well once I'm rasing the app to FS mode. It's also a lot of work to add something new later. The geometry has to adjusted by hand for each and every screen object. So in the long term it's not the way to go with. I saw Rene mentioning using NetBeans for GUI building as well. I installed NetBeans after I read the mail, and it looks pretty easy to build a GUI and to compile it to a jar file. But I have no idea how to make the final step, to "drive it from NetRexx". Will it be as easy as clicking the GUI together, mark the elements as public and create the javadoc to see how do I have to access the elements of the GUI? (I assume, the elements might be kept private, once I find the switch to generate javadoc including private methods and how I add my NetRexx code to the project/package(?)) A small example will be helpful to get it. TIA kp _______________________________________________ Ibm-netrexx mailing list [hidden email] |
Wouldn't want this one to slip. As I worked in a little app to use as an example in my reply, it came upon me that this could be best suited for a little tutorial. I'm doing just that at the moment. --- Saludos / Kind regards. David Requena El 06/10/2010 21:29, KP Kirchdoerfer escribió: Am Dienstag, 5. Oktober 2010, 16:31:27 schrieb David Requena:El 05/10/2010 2:22, George Hovey escribió:Hope David Requena weighs in on this - I think he is pretty GUI aware.While that might be true, I've to say it'd be more out of sheer stubbornness in tackling hard challenges than out of any practical matter :-) Non-trivial GUIs are not easy to make from NetRexx nor from java itself. FWIW the only reasonable way to do this is by taking advantage of the fact that java classes and NetRexx's own are the very same thing. So my advice is: do use NetBeans' wonderful point & click tools to make your GUI, compile it, and then drive it from your NetRexx program. Use your time to do more interesting things with NetRexx :-) I think René is also using this approach in his projects. See http://www.rexxla.org/events/2004/renej.pdfWith the help of Quique's "HowTo" I've been able start with a GUI. It came out as a nice example to learn a lot about java, using java classes from NetRexx and to read javadocs the other way round. I do have some working code, but it's a eak GUI - e.g. it doesn't play well once I'm rasing the app to FS mode. It's also a lot of work to add something new later. The geometry has to adjusted by hand for each and every screen object. So in the long term it's not the way to go with. I saw Rene mentioning using NetBeans for GUI building as well. I installed NetBeans after I read the mail, and it looks pretty easy to build a GUI and to compile it to a jar file. But I have no idea how to make the final step, to "drive it from NetRexx". Will it be as easy as clicking the GUI together, mark the elements as public and create the javadoc to see how do I have to access the elements of the GUI? (I assume, the elements might be kept private, once I find the switch to generate javadoc including private methods and how I add my NetRexx code to the project/package(?)) A small example will be helpful to get it. TIA kp _______________________________________________ Ibm-netrexx mailing list [hidden email] _______________________________________________ Ibm-netrexx mailing list [hidden email] |
In reply to this post by Quique Britto
Hello Quique, & all,
as you might know from this group, I'm doing some NetRexx development, and, amongst others, try to implement some new 'statements' like SHOW and ACCEPT for screen I/O (GUI I/O), generating NetRexx Code which uses SWING in turn. I would be interested to get advise from individuals fluent in Java SWING for this (as I am just starting learning SWING by my own, currently). Maybe we can create a topic called NetRexx GUI for discussing this? I would be willing to implement the generator part, when we did agree on the syntax and semantics needed. Any volunteers ? Thomas Schneider. ============================================================= Am 05.10.2010 18:19, schrieb Quique Britto: I ended up purchasing a Java Book as I find the Javadoc too much for my eyes. --
Thomas Schneider Projects ReyC & LOGOS on www.KENAI.com _______________________________________________ Ibm-netrexx mailing list [hidden email]
Tom. (ths@db-123.com)
|
In reply to this post by Fernando Cassia-2
Hi Fernando,
could you send me a short mail privately what 'wget' does and where I can find it? Or do I have simply to google 'wget' ??? Thomas. =========================================================== Am 05.10.2010 18:40, schrieb Fernando Cassia: > On Tue, Oct 5, 2010 at 1:19 PM, Quique Britto<[hidden email]> wrote: >> I ended up purchasing a Java Book as I find the Javadoc too much for my >> eyes. >> I have started writing a tutorial for writing Netrexx programs using Java >> Swing, it's basically a shortcut for people who wish to use Swing and >> Netrexx. >> >> http://www.esimplesoft.es/ > Quique, > > Very nice, but I´d add a link at the end of each section, linking to the next. > That´d make wget -m -np -k -c http://url much easier :) > > FC > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > > -- Thomas Schneider Projects ReyC & LOGOS on www.KENAI.com _______________________________________________ Ibm-netrexx mailing list [hidden email]
Tom. (ths@db-123.com)
|
Free forum by Nabble | Edit this page |