467,114 Members | 1,273 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,114 developers. It's quick & easy.

Jython/Python and javax.swing.*

I'm using Jython and in the python script I do:

from javax import swing
result = javax.swing.JOptionPane.showInputDialog(wC, cmd[8:],"Prompt
from " + client.serverName, JOptionPane.PLAIN_MESSAGE)

wC is a JFrame, cmd is a String and client.serverName is a String.
It won't show the JOptionPane, why?

Jul 18 '05 #1
  • viewed: 4519
Share:
3 Replies
Sherrod Faulks <bi****@verizon.net> wrote in message news:<2004082212534416807%birded@verizonnet>...
I'm using Jython and in the python script I do:

from javax import swing
result = javax.swing.JOptionPane.showInputDialog(wC, cmd[8:],"Prompt
from " + client.serverName, JOptionPane.PLAIN_MESSAGE)

wC is a JFrame, cmd is a String and client.serverName is a String.
It won't show the JOptionPane, why?


Hi Sherrod,

Hope this helps. It's a bit longer than your script. (I've also
changed
'client.serverName' to 'client_serverName' to make my script work -
but this is only cosmetic and 'client.serverName' will work fine in
your script assuming
it resolves to a string.)

import javax.swing.JOptionPane as JOptionPane
import javax.swing.JFrame as JFrame
wC = JFrame('jython')
cmd = 'JythonJython'
client_serverName = 'name'
result = JOptionPane.showInputDialog(wC, cmd[8:],"Prompt from " +
client_serverName, JOptionPane.PLAIN_MESSAGE)

Best wishes,

John
Jul 18 '05 #2
Sherrod Faulks <bi****@verizon.net> wrote in message news:<2004082212534416807%birded@verizonnet>...
I'm using Jython and in the python script I do:

from javax import swing
result = javax.swing.JOptionPane.showInputDialog(wC, cmd[8:],"Prompt
from " + client.serverName, JOptionPane.PLAIN_MESSAGE)

wC is a JFrame, cmd is a String and client.serverName is a String.
It won't show the JOptionPane, why?


Hi Sherrod,

Having had a look at my last post after a nights sleep I'm not sure it
was very clear...

If you change your script to the following it should work:

import javax.swing as swing
result = swing.JOptionPane.showInputDialog(wC, cmd[8:],"Promptfrom " +
client.serverName, swing.JOptionPane.PLAIN_MESSAGE)

Cheers,

John
Jul 18 '05 #3
John,
Sorry I didn't reply earlier, but I found out how to do it in the
Jython Doc. You must do:

from pawt import swing

Thanks for helping, though!

On 2004-08-23 07:03:12 -0400, cr*********@btinternet.com (John Crichton) said:
Sherrod Faulks <bi****@verizon.net> wrote in message
news:<2004082212534416807%birded@verizonnet>...
I'm using Jython and in the python script I do:

from javax import swing
result = javax.swing.JOptionPane.showInputDialog(wC, cmd[8:],"Prompt
from " + client.serverName, JOptionPane.PLAIN_MESSAGE)

wC is a JFrame, cmd is a String and client.serverName is a String.
It won't show the JOptionPane, why?


Hi Sherrod,

Having had a look at my last post after a nights sleep I'm not sure it
was very clear...

If you change your script to the following it should work:

import javax.swing as swing
result = swing.JOptionPane.showInputDialog(wC, cmd[8:],"Promptfrom " +
client.serverName, swing.JOptionPane.PLAIN_MESSAGE)

Cheers,

John

Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Asad Khan | last post: by
reply views Thread by Matt Newcomb | last post: by
reply views Thread by Sherrod Faulks | last post: by
1 post views Thread by Nandan | last post: by
6 posts views Thread by Mike Wimpe | last post: by
4 posts views Thread by Nadeem Mohsin | last post: by
2 posts views Thread by donkeyboy | last post: by
5 posts views Thread by sarup26@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.