由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 怎样才能Firefox add-on和java程序之间传递数据
相关主题
GUI问题如何输出TXT文件?
java 响应速度问题Re: help with JTextArea
what is best for Java Desktop GUIsolvedRe: how to change the input mode?
how to read from a non-return socket stream?How to wrap line at specific position?
Re: Client-Server and actionPerformedhow to transfer data between two sockets
Java.Net初学: 我的简单问题, 寻求简单方案Socket Connection refused in high-loaded servers
Re: JTextArea的内容不滚动如何在TextArea里面画位图
Re: AWT 和 SWING 在程序应用中有什么区别?如何控制文本输入的左界限?比如不准到上一行,不准回到第一个
相关话题的讨论汇总
话题: firefox话题: java话题: data话题: url话题: server
进入Java版参与讨论
1 (共1页)
s*******y
发帖数: 558
1
譬如说在Firefox上面加一个自定义的button, 当click button后, URL 栏里面的地址
可以传递给另外一个stand-alone的java程序, 在其GUI界面上(e.g. jTextArea)显示
出Firefox当前URL的值。
请问哪位大侠知道J2SE里面怎么实现么? 谢谢了
谢谢
g******e
发帖数: 3760
2
socket

地址
显示

【在 s*******y 的大作中提到】
: 譬如说在Firefox上面加一个自定义的button, 当click button后, URL 栏里面的地址
: 可以传递给另外一个stand-alone的java程序, 在其GUI界面上(e.g. jTextArea)显示
: 出Firefox当前URL的值。
: 请问哪位大侠知道J2SE里面怎么实现么? 谢谢了
: 谢谢

g*****g
发帖数: 34805
3
I don't know much about FF plugin, but I think it's just a native
program which can do anything on your OS.
So you certainly can launch a command like
java ShowUrl your_url
pass your_url into ShowUrl class and display it.

地址
显示

【在 s*******y 的大作中提到】
: 譬如说在Firefox上面加一个自定义的button, 当click button后, URL 栏里面的地址
: 可以传递给另外一个stand-alone的java程序, 在其GUI界面上(e.g. jTextArea)显示
: 出Firefox当前URL的值。
: 请问哪位大侠知道J2SE里面怎么实现么? 谢谢了
: 谢谢

c*****t
发帖数: 1879
4
Used to be called LiveConnect for firefox 1.x, but for 2.0, there
is a new API.
http://developer.mozilla.org/en/docs/Gecko_Plugin_API_Reference:Scripting_plugins
It only works for applets though.
For standalone app, you try monitor the clip board (not sure if there
is an event) and use JavaScript to copy text to clipboard (works for
IE, not sure about FireFox).

地址
显示

【在 s*******y 的大作中提到】
: 譬如说在Firefox上面加一个自定义的button, 当click button后, URL 栏里面的地址
: 可以传递给另外一个stand-alone的java程序, 在其GUI界面上(e.g. jTextArea)显示
: 出Firefox当前URL的值。
: 请问哪位大侠知道J2SE里面怎么实现么? 谢谢了
: 谢谢

g******e
发帖数: 3760
5
I think he wanted to pass some data to another running program. I have a
project doing similar thing so I's like to hear you guys ideas too.

【在 g*****g 的大作中提到】
: I don't know much about FF plugin, but I think it's just a native
: program which can do anything on your OS.
: So you certainly can launch a command like
: java ShowUrl your_url
: pass your_url into ShowUrl class and display it.
:
: 地址
: 显示

g*****g
发帖数: 34805
6
One simple way would be listening on socket, and write data into it.
You can also share some file and write into it, the other program check
the file periodly.

【在 g******e 的大作中提到】
: I think he wanted to pass some data to another running program. I have a
: project doing similar thing so I's like to hear you guys ideas too.

g******e
发帖数: 3760
7
Thanks. Socket is my first thought too.
My project is a bit different. The data(command) being passed is pretty
complex so I may need to define a set of protocol for that. My other thought
is to pass data directly from server (we only use browser as a UI and the
data is actually on the server side) so that I can skip the browser plugin (
the part I don't like).

【在 g*****g 的大作中提到】
: One simple way would be listening on socket, and write data into it.
: You can also share some file and write into it, the other program check
: the file periodly.

g*****g
发帖数: 34805
8
Sure, if data is already captured on server, then there's no point to
use a plugin. And you don't need to define protocol yourself, if you are
java to java, mark your data transfer object serializable would be enough,
either writeObject on socket, or use web service / Hessian.
If it's another language to Java, you can still use web service.

thought
(

【在 g******e 的大作中提到】
: Thanks. Socket is my first thought too.
: My project is a bit different. The data(command) being passed is pretty
: complex so I may need to define a set of protocol for that. My other thought
: is to pass data directly from server (we only use browser as a UI and the
: data is actually on the server side) so that I can skip the browser plugin (
: the part I don't like).

s*******y
发帖数: 558
9
那请问firefox怎么建立socket呢?

【在 g*****g 的大作中提到】
: One simple way would be listening on socket, and write data into it.
: You can also share some file and write into it, the other program check
: the file periodly.

g******e
发帖数: 3760
10
Most likely they will be in different languages and platforms so I will
consider soap (or lighter protocol like json). One other thing makes it
tricky is the server side may have to push the data to the client side since
only server knows when the data is ready. Anybody knows about some Java
reference implementation of push server (client)?

【在 g*****g 的大作中提到】
: Sure, if data is already captured on server, then there's no point to
: use a plugin. And you don't need to define protocol yourself, if you are
: java to java, mark your data transfer object serializable would be enough,
: either writeObject on socket, or use web service / Hessian.
: If it's another language to Java, you can still use web service.
:
: thought
: (

1 (共1页)
进入Java版参与讨论
相关主题
如何控制文本输入的左界限?比如不准到上一行,不准回到第一个Re: Client-Server and actionPerformed
JTextArea 生成之后怎么知道有多少行,列?Java.Net初学: 我的简单问题, 寻求简单方案
JTextArea行间距如何设定?Re: JTextArea的内容不滚动
如何强令JTextArea显示最末一行Re: AWT 和 SWING 在程序应用中有什么区别?
GUI问题如何输出TXT文件?
java 响应速度问题Re: help with JTextArea
what is best for Java Desktop GUIsolvedRe: how to change the input mode?
how to read from a non-return socket stream?How to wrap line at specific position?
相关话题的讨论汇总
话题: firefox话题: java话题: data话题: url话题: server