chirag bhalla

Greenhorn
+ Follow
since Apr 18, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by chirag bhalla

Originally posted by Pat Farrell:
Try it and see if you like it.

Just be warned, that when you see it work, you only know that it works on that day on that OS with that JVM. And sadly, sometimes its only on that version of that OS, etc.



Hi,

I've been through it and its working just fine on Windows...

But till now i'm unable to get it done on Linux...

Can someone please let me know about the infrastructural settings like path settings and placement of jdic.jar and .so files on LINUX..

And please also let me know that if it can run smoothly on LINUX 7.3

Your posts will be highly appreciated.

Thanks.
15 years ago

Originally posted by Pat Farrell:
Try it and see if you like it.

Just be warned, that when you see it work, you only know that it works on that day on that OS with that JVM. And sadly, sometimes its only on that version of that OS, etc.



Thanks for your concern.

But let me give it a try.

I'll let you guys know about its efficiency.
15 years ago

Originally posted by shan Iyer:
I tried it yesterday night ...... and Lo !! My manager appeared ......



I wish in the latest java release SUN would have provided us with an API to call those spirits.

And the concerned method would have been looked like:

invokeDeadSpirit("NAME_OF_THE_SPIRIT","DATE_OF_DEATH");

15 years ago

Originally posted by Pat Farrell:


My suggested is to use a Java library, such as the one in Java Commons, there are many. Or you can write your own from the RFC. HTTP is really a simple protocol.



I've started thinking in a little bit different way.

If i use JDIC(JDesktop Integration Components) to display the relevant web page in my application then I hope we will be able to to get the print of that web page from there.

What you guys have to say?
15 years ago

Originally posted by Devesh Chanchlani:
Hello Everybody,
I passed SCJP 5.0 with 97%. Thanks to all those who participate so actively in this forum.

Devesh Chanchlani.

Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed.



Congrats....
15 years ago
Hi all,

I've to use JDIC( JDesktop Integration Components ) to display a web page in my swing application.

As of now i was using JEditorPane for the same but its performance is very poor and it's unable to show graphically rich web page. I guess its compatibility with HTML is very poor.

I'm using JDK1.4 on Windows XP.

Can someone please let me know how can i use JDIC in the environment mentioned above.

Where can i get JDIC API and all relevant .dll files and what are the corressponing classpath settings and placement of jdic.jar package which i would need to implement.

Any materialistic solution will be highly appreciated.

Thanks in Advance.
15 years ago

Originally posted by Pat Farrell:
I would not call this idea "better", but I'll toss it out anyway.

There are plenty of Java libraries that act as a HTTP client, i.e. a web browser. You can send the GET command to the URL, and get the response. You can walk the resulting HTML/mime types and do what you want.

I had to do this for a customer who used a proprietary image management system that would only return PDF files. So I write code to act like a web browser, got the PDF file, and then processed it.

Apache and others have fairly nice libraries to do all the hard work.

Printing, is, of course, very hard to do in a truly system, OS, hardware, and printer independent way.




Thanks Pat...

But i've do all these in my swing application.

I can't use APACHE or anything like that. All i've to do will be a totaly (.java) file.
15 years ago

Originally posted by Paul Clapham:
You didn't say why you were opposed to using Yahoo's APIs which they supply so you can do things like what you're asking.



I'm not opposed to any thing. I'm open to all the feasible solutions.

I'm just questioning that if it would be the most appropriate way of fixing my problem.

If it is then can you please give me some more details like how can i get the help of Yahoo Map APIs in my pure core java(.java) file.
What are the things which need to be taken care of?

Please put some more light.

Thanks
15 years ago
Hi all,

I have to display a browser(entire web page) inside my swing application.

I tried with the component "JEditorPane".

It is quite capable of doing so but when we try to open a graphically rich web page with JEditorPane it just couldn't do so and can't show the web page in the actual format with lots of things not being displayed there.

I just want to know that is there any substitute of the JEditorPane which can handle the same task without loosing any content of the web page.

Any materialistic solution will be highly appreciated.
[ April 21, 2008: Message edited by: chirag bhalla ]
15 years ago

Originally posted by Paul Clapham:
In this particular case you might be better off using Yahoo's mapping APIs for accessing their site instead of trying to scrape their HTML. Unless you really want to interpret the Javascript that displays that page.




is there any other good approach to do the same.

I've to do all these by using core java(swing application) only. I can't use web technologies like j2ee etc.
15 years ago

Originally posted by Paul Clapham:
Could I suggest that your real requirement is the second sentence there, not the first? That's what it sounds like to me. In which case you don't need to print something that looks exactly like that page with all its irrelevant links and so on, you just need to extract the part of the page which contains the driving directions and print them?

If that's the case you don't need something that can mimic the full rendering power of a web browser, you just need something that can parse HTML and extract certain text from it. And that's a lot simpler.




Thanks Paul...

You got me right.

That is exactly what i am looking for. I just need to get the text which shows DRIVING DIRECTIONS in left side of the web page.

But when i try to parse HTML and extract certain text from the web page, i'm just unable to get the desired data from the whole web page.
What i get is name of links, some captions and some garbage kind of text.
I guess, this is because of the least compatibility between swing components and HTML.
I'm using file handling code to extract certain text from the web page.

As you said above in your post that it seems a lot easier to you, then could you please give me a solution or hint in which i can move further.

Thanks for your effort.
15 years ago

Originally posted by Ulf Dittmer:
I'm not at all sure that you can't do the same with a native browser - you were asking for a Java solution.

You could do some research into what command line options the major browsers support; maybe there's one that tells the browser to load a page and print it. If there is, you could use the Runtime.exec method to run it.

[ April 19, 2008: Message edited by: Ulf Dittmer ]



Thanks for giving me a way towards which i can move..

But meanwhile, if someone got a better way regarding this problem then please post your comments.

Thanks in advance...
[ April 19, 2008: Message edited by: chirag bhalla ]
15 years ago

Originally posted by Ulf Dittmer:
Welcome to JavaRanch.

That's a tough one. You may be able to get an all-Java web browser to open and print the page through its API.



Thanks for your quick reply...

But are you quite sure that we would be unable to do the same by using any dominant web browser like IE6 or Mozilla Firefox or Opera.

Can you put some more light and give me a way to follow.

Your effort will be highly appreciated.
15 years ago
Hi all,

I need to print a web page by using my core java application only.

I actualy need to print driving directions between two places in my application.
Suppose this is the URL of web page whose printing is needed.

http://maps.yahoo.com/#mvt=m&lat=38.203765&lon=-122.003865&zoom=10&q1=94618&q2=95616

I'm able to hit the site and pass search criteria there from my swing application but i'm unable to find a way so that i can get the printout from my own program.
15 years ago