Skip to main content

[JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

12 replies [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kaveh Mousavi

No, not at all,
Every thing is ok in the program it will show google page nicely mouse clicks will bring you to other pages
Just when I go to input box of the page to enter something to search, nothing happens when I press keys, I cant type anything in the browser, can't enter anything for search, the same for other sites.

browser responses to mouse clicks, but not to keypress,
I dont want to add key listener to do anything speacial with keypress, just I am wonering why the broswer wont get input from keyboard.

------------------------
The GNU Operating System
Free as in Freedom
http://www.gnu.org

----- Original Message ----
From: Base
To: jdic@jdic.dev.java.net
Sent: Friday, November 30, 2007 11:17:14 AM
Subject: Re: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

DIV {
MARGIN:0px;}

You wanna make a key listener to get the

inputs?

----- Original Message -----

From:

Kaveh Mousavi

To: jdic@jdic.dev.java.net

Sent: Friday, November 30, 2007 1:22 PM

Subject: Re: [JDIC] JDIC WebBrowser in Jpanel

wont respond to keyboard input events

No,

I wont do,
It is displayed perfectly, I have no problem in using WebBrowser

unless making it to be able to get inputs (For example get the test I type in

search box).
Is it working for you for getting keyboard inputs?
What is

you system and broswer?

-----

Original Message ----
From: Base
To: jdic@jdic.dev.java.net
Sent:

Friday, November 30, 2007 6:35:00 AM
Subject: Re: [JDIC] JDIC WebBrowser in

Jpanel wont respond to keyboard input events

Maybe u can try

this:

public class JDICTest extends JFrame{
public

JDICTest(){

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

Container c = getContentPane();
c.setLayout(new

BorderLayout());
try{

WebBrowser webBrowser = new WebBrowser(new URL("http://www.google.com"));

webBrowser.setSize(800, 400);

webBrowser.setEnabled(true);

c.add(webBrowser, BorderLayout.CENTER);

c.validate();

}catch(Exception e){

e.printStackTrace();
}

}

public static void main(String[] args){

JDICTest test = new JDICTest();

test.pack();

test.setVisible(true);
}
}

----- Original

Message -----
From: "Kaveh Mousavi"
To:
Sent:

Friday, November 16, 2007 12:44 PM
Subject: [JDIC] JDIC WebBrowser in

Jpanel wont respond to keyboard input events

>I am adding a

WebBrowser component from JDIC to a
> JPanel by creating it at

runtime.
> The code is like this
>
>

WebBrowser webBrowser;
>

> webBrowser = new

WebBrowser(new
> URL("http://www.google.com"));
>

webBrowser.setSize(800, 400);
>

webBrowser.setEnabled(true);
>

>
>

jPanel1.add(webBrowser);
>

jPanel1.validate();
>
>

>
>
> When I run the program in netbeans (6beta2),

by
> pressing the button that will run mentions code, the
> google.com page will be displayed

and I can work in it
> with mouse but I can't enter anything in the

search bo
> by keyboard. No keypress is working.
> What is wrong

in my code and what should I do?
>
> I am using seamonkey and

netbeans.
>
> ------------------------
> The GNU Operating

System
> Free as in Freedom
> http://www.gnu.org
>
>

---------------------------------------------------------------------
>

To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
>

For additional commands, e-mail: jdic-help@jdic.dev.java.net
>

[att1.html]

Base

See, but I have never meet this problem.
Env: Windows XP,IE,jdk1.6.

And my problem is the listener from swing for inputs.
----- Original Message -----
From: Kaveh Mousavi
To: jdic@jdic.dev.java.net
Sent: Friday, November 30, 2007 4:17 PM
Subject: Re: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

No, not at all,
Every thing is ok in the program it will show google page nicely mouse clicks will bring you to other pages
Just when I go to input box of the page to enter something to search, nothing happens when I press keys, I cant type anything in the browser, can't enter anything for search, the same for other sites.

browser responses to mouse clicks, but not to keypress,
I dont want to add key listener to do anything speacial with keypress, just I am wonering why the broswer wont get input from keyboard.

------------------------
The GNU Operating System
Free as in Freedom
http://www.gnu.org

----- Original Message ----
From: Base
To: jdic@jdic.dev.java.net
Sent: Friday, November 30, 2007 11:17:14 AM
Subject: Re: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

You wanna make a key listener to get the inputs?
----- Original Message -----
From: Kaveh Mousavi
To: jdic@jdic.dev.java.net
Sent: Friday, November 30, 2007 1:22 PM
Subject: Re: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

No, I wont do,
It is displayed perfectly, I have no problem in using WebBrowser unless making it to be able to get inputs (For example get the test I type in search box).
Is it working for you for getting keyboard inputs?
What is you system and broswer?

----- Original Message ----
From: Base
To: jdic@jdic.dev.java.net
Sent: Friday, November 30, 2007 6:35:00 AM
Subject: Re: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

Maybe u can try this:

public class JDICTest extends JFrame{
public JDICTest(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container c = getContentPane();
c.setLayout(new BorderLayout());
try{
WebBrowser webBrowser = new WebBrowser(new URL("http://www.google.com"));
webBrowser.setSize(800, 400);
webBrowser.setEnabled(true);

c.add(webBrowser, BorderLayout.CENTER);
c.validate();
}catch(Exception e){
e.printStackTrace();
}
}

public static void main(String[] args){
JDICTest test = new JDICTest();
test.pack();
test.setVisible(true);
}
}

----- Original Message -----
From: "Kaveh Mousavi"
To:
Sent: Friday, November 16, 2007 12:44 PM
Subject: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

>I am adding a WebBrowser component from JDIC to a
> JPanel by creating it at runtime.
> The code is like this
>
> WebBrowser webBrowser;
>
> webBrowser = new WebBrowser(new
> URL("http://www.google.com"));
> webBrowser.setSize(800, 400);
> webBrowser.setEnabled(true);
>
>
> jPanel1.add(webBrowser);
> jPanel1.validate();
>
>
>
>
> When I run the program in netbeans (6beta2), by
> pressing the button that will run mentions code, the
> google.com page will be displayed and I can work in it
> with mouse but I can't enter anything in the search bo
> by keyboard. No keypress is working.
> What is wrong in my code and what should I do?
>
> I am using seamonkey and netbeans.
>
> ------------------------
> The GNU Operating System
> Free as in Freedom
> http://www.gnu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
> For additional commands, e-mail: jdic-help@jdic.dev.java.net
>

[att1.html]

lifeaustin156
Offline
Joined: 2007-11-24

Hey I am using WindowXp with JDK 1.5 and it can take Mouse Click and Keyboard inputs if the browser is embeded in JFrame, but when I try to embed it in a JWindow both mouse Click and Keyboard stops responding!

Can anybody suggest a workaround and why this is happening???
Why there is a diff in behaviour between JFrame and Jwindow?

Message was edited by: lifeaustin156

Kaveh Mousavi

No, I wont do,
It is displayed perfectly, I have no problem in using WebBrowser unless making it to be able to get inputs (For example get the test I type in search box).
Is it working for you for getting keyboard inputs?
What is you system and broswer?

----- Original Message ----
From: Base
To: jdic@jdic.dev.java.net
Sent: Friday, November 30, 2007 6:35:00 AM
Subject: Re: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

Maybe u can try this:

public class JDICTest extends JFrame{
public JDICTest(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container c = getContentPane();
c.setLayout(new BorderLayout());
try{
WebBrowser webBrowser = new WebBrowser(new
URL("http://www.google.com"));
webBrowser.setSize(800, 400);
webBrowser.setEnabled(true);

c.add(webBrowser, BorderLayout.CENTER);
c.validate();
}catch(Exception e){
e.printStackTrace();
}
}

public static void main(String[] args){
JDICTest test = new JDICTest();
test.pack();
test.setVisible(true);
}
}

----- Original Message -----
From: "Kaveh Mousavi"
To:
Sent: Friday, November 16, 2007 12:44 PM
Subject: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard
input events

>I am adding a WebBrowser component from JDIC to a
> JPanel by creating it at runtime.
> The code is like this
>
> WebBrowser webBrowser;
>
> webBrowser = new WebBrowser(new
> URL("http://www.google.com"));
> webBrowser.setSize(800, 400);
> webBrowser.setEnabled(true);
>
>
> jPanel1.add(webBrowser);
> jPanel1.validate();
>
>
>
>
> When I run the program in netbeans (6beta2), by
> pressing the button that will run mentions code, the
> google.com page will be displayed and I can work in it
> with mouse but I can't enter anything in the search bo
> by keyboard. No keypress is working.
> What is wrong in my code and what should I do?
>
> I am using seamonkey and netbeans.
>
> ------------------------
> The GNU Operating System
> Free as in Freedom
> http://www.gnu.org

>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
> For additional commands, e-mail: jdic-help@jdic.dev.java.net
>

[att1.html]

Base

You wanna make a key listener to get the inputs?
----- Original Message -----
From: Kaveh Mousavi
To: jdic@jdic.dev.java.net
Sent: Friday, November 30, 2007 1:22 PM
Subject: Re: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

No, I wont do,
It is displayed perfectly, I have no problem in using WebBrowser unless making it to be able to get inputs (For example get the test I type in search box).
Is it working for you for getting keyboard inputs?
What is you system and broswer?

----- Original Message ----
From: Base
To: jdic@jdic.dev.java.net
Sent: Friday, November 30, 2007 6:35:00 AM
Subject: Re: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

Maybe u can try this:

public class JDICTest extends JFrame{
public JDICTest(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container c = getContentPane();
c.setLayout(new BorderLayout());
try{
WebBrowser webBrowser = new WebBrowser(new URL("http://www.google.com"));
webBrowser.setSize(800, 400);
webBrowser.setEnabled(true);

c.add(webBrowser, BorderLayout.CENTER);
c.validate();
}catch(Exception e){
e.printStackTrace();
}
}

public static void main(String[] args){
JDICTest test = new JDICTest();
test.pack();
test.setVisible(true);
}
}

----- Original Message -----
From: "Kaveh Mousavi"
To:
Sent: Friday, November 16, 2007 12:44 PM
Subject: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

>I am adding a WebBrowser component from JDIC to a
> JPanel by creating it at runtime.
> The code is like this
>
> WebBrowser webBrowser;
>
> webBrowser = new WebBrowser(new
> URL("http://www.google.com"));
> webBrowser.setSize(800, 400);
> webBrowser.setEnabled(true);
>
>
> jPanel1.add(webBrowser);
> jPanel1.validate();
>
>
>
>
> When I run the program in netbeans (6beta2), by
> pressing the button that will run mentions code, the
> google.com page will be displayed and I can work in it
> with mouse but I can't enter anything in the search bo
> by keyboard. No keypress is working.
> What is wrong in my code and what should I do?
>
> I am using seamonkey and netbeans.
>
> ------------------------
> The GNU Operating System
> Free as in Freedom
> http://www.gnu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
> For additional commands, e-mail: jdic-help@jdic.dev.java.net
>

[att1.html]

Base

Maybe u can try this:

public class JDICTest extends JFrame{
public JDICTest(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container c = getContentPane();
c.setLayout(new BorderLayout());
try{
WebBrowser webBrowser = new WebBrowser(new URL("http://www.google.com"));
webBrowser.setSize(800, 400);
webBrowser.setEnabled(true);

c.add(webBrowser, BorderLayout.CENTER);
c.validate();
}catch(Exception e){
e.printStackTrace();
}
}

public static void main(String[] args){
JDICTest test = new JDICTest();
test.pack();
test.setVisible(true);
}
}

----- Original Message -----
From: "Kaveh Mousavi"
To:
Sent: Friday, November 16, 2007 12:44 PM
Subject: [JDIC] JDIC WebBrowser in Jpanel wont respond to keyboard input events

>I am adding a WebBrowser component from JDIC to a
> JPanel by creating it at runtime.
> The code is like this
>
> WebBrowser webBrowser;
>
> webBrowser = new WebBrowser(new
> URL("http://www.google.com"));
> webBrowser.setSize(800, 400);
> webBrowser.setEnabled(true);
>
>
> jPanel1.add(webBrowser);
> jPanel1.validate();
>
>
>
>
> When I run the program in netbeans (6beta2), by
> pressing the button that will run mentions code, the
> google.com page will be displayed and I can work in it
> with mouse but I can't enter anything in the search bo
> by keyboard. No keypress is working.
> What is wrong in my code and what should I do?
>
> I am using seamonkey and netbeans.
>
> ------------------------
> The GNU Operating System
> Free as in Freedom
> http://www.gnu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
> For additional commands, e-mail: jdic-help@jdic.dev.java.net
>

sergeds
Offline
Joined: 2008-01-24

I'm having the same problem. Identical code, runs fine in Windows (using the Modzilla browser) but under Linux I cannot input text in any form.

I played around with the source code and noticed that when the WebBrowser is changed to extend JPanel instead of Canvas, text input works, but the browser keeps starting up in its own frame. (Even when it is added to a JPanel).

I've tried numerous combinations and it always comes down to:
- possible to add the browser as a component to a JPanel but no text input possible
- text input possible, but browser cannot be added to the JPanel

jorgev
Offline
Joined: 2008-03-11

Same problem using jdic with Mozilla in linux.

Has anyone any idea to solve this?

Is there any bug opened?

ashikaumanga
Offline
Joined: 2008-04-01

hi guys,
I had a similar problem with MAC and I solved it by little modification to 'libjdic.jnilib'.
I think the same solution might work for Linux.(in Linux its probally the MozEmbed.cpp )

Answer is at last post of thread :
http://forums.java.net/jive/thread.jspa?threadID=34543&tstart=0

Hope this helps.
regards

Kaveh Mousavi

I am adding a WebBrowser component from JDIC to a
JPanel by creating it at runtime.
The code is like this

WebBrowser webBrowser;

webBrowser = new WebBrowser(new
URL("http://www.google.com"));
webBrowser.setSize(800, 400);
webBrowser.setEnabled(true);

jPanel1.add(webBrowser);
jPanel1.validate();

When I run the program in netbeans (6beta2), by
pressing the button that will run mentions code, the
google.com page will be displayed and I can work in it
with mouse but I can't enter anything in the search bo
by keyboard. No keypress is working.
What is wrong in my code and what should I do?

I am using seamonkey and netbeans.

------------------------
The GNU Operating System
Free as in Freedom
http://www.gnu.org

---------------------------------------------------------------------
To unsubscribe, e-mail: jdic-unsubscribe@jdic.dev.java.net
For additional commands, e-mail: jdic-help@jdic.dev.java.net

lifeaustin156
Offline
Joined: 2007-11-24

I have seen that if the browser is embeded in the JWindow or JInternal frame even then the mouse clcik and button does not work

lifeaustin156
Offline
Joined: 2007-11-24

When I m adding Browser to JTabbedPane I m getting a space above the browser . Does anybody have an idea why this space is comming between the Tab and the browser. Its very frustating