Java Applet Locks IE Window During Printing

Feb 14, 2011

I have created a Java Applet that will be used in IE to print images from a remote server. I load the applet in a new popup window from my main web page and it prints fine, but it locks up the new popup browser window while it is printing. When the print job is complete the popup window becomes responsive again. The main browser window remains functional during the printing. Is there something I can do during the printing process to cause it to yield so the popup does not lock up?

package javaprint;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.awt.print.*;
import java.io.IOException;
import java.io.InputStream;
import java.net.Proxy;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
public class jPrinter implements Printable
{
String ASP_NET_SessionId = null;
ArrayList<URL> pages = new ArrayList<URL>();
BufferedImage lastImage = null;
int lastRequestedIndex = 1;
public EcPrinter(ArrayList<URL> pages, String sessionId)
{
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
ImageIO.setUseCache(false);
this.pages = pages;
ASP_NET_SessionId = sessionId;
}
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
{
if (pageIndex < pages.size())
{
URL url = pages.get(pageIndex);
BufferedImage img = null;
if (pageIndex == lastRequestedIndex)
{
img = lastImage;
}
else
{
URLConnection connection = url.openConnection(Proxy.NO_PROXY);
connection.setRequestProperty("Cookie", "ASP.NET_SessionId=" + ASP_NET_SessionId);
InputStream is = connection.getInputStream();
img = ImageIO.read(is);
lastImage = img;
}
graphics.drawImage(img, 0, 0, null);
return PAGE_EXISTS;
}
return NO_SUCH_PAGE;
}
}

View 1 Replies


Similar Messages:

Using A Java Applet In A SharePoint Web Part

Dec 3, 2010

I have a need to integrate a third-party Java applet into a custom web part I wrote for SharePoint 2007. The web part simply loads a user control I created that contains the bulk of the functionality, and that's where the applet will go. I added it to my user control project and it works fine outside of my SharePoint environment.

I installed the updated web part onto my MOSS 2007 development site and the part's page loads fine. The applet is triggered by clicking a link button on the page, which runs some client-side JavaScript to start it. The problem is nothing seems to happen when I click the link. No error messages appear, and the stuff the applet is supposed to do never occurs (it's for doing file transfers via FTP). I have the .jar file as an embedded resource in my user control DLL, which is deployed to the bin folder, and SharePoint fully trusts this DLL.

I used Firebug to step through the initialization code and I saw an HTTP GET that failed with a message about not being authorized, but it didn't give any details and I'm not positive it was related to the applet. Is there anything special I need to do to make the applet work? Or am I going about this the wrong way?

EDIT: The problem turned out to be the .jar file for the applet couldn't be found. SharePoint is clearly doing something different here, and I need to find out what. Can Java applets be used within a SharePoint site? This question suggests they can, but in that case a Page Viewer web part was used, which isn't going to really work for me.

View 2 Replies

Inject Java Applet In A Website

Jan 6, 2011

I had came acroos an open source a java applet. I wanted to know is there somehow I could create a script that could be distributed and the applet could be embedded in any website? I have been able to inject jquery and JS scripts into websites by placing a tag pointing to a Javascript file and placing it in the header of the page but I don't know how a java applet can be injected?

View 1 Replies

Upload A File Using Java Applet To Sites?

Jun 6, 2010

how to upload a file using java applet to asp.net sites.

View 1 Replies

Web Forms :: Reload Of A Page With Java Applet

Feb 21, 2011

I have an aspx page with a java applet. At the end of the execution, the applet navigates to another aspx page, in which there is a button that gives the possibility to execute the applet again. I would like this second page to reload every time the applet calls it, but unfortunatelly this doesn't happen. If I start from the applet's page, all works fine; but if I call the applet's page from the other one, when the applet redirects to this second page the load event does not fire. Probably the code could be clearer, so this is it:

Dummy.aspx

[Code]....

Dummy.aspx.vb

[Code]....

View 2 Replies

Inject Java Applet In Any Website Through Script

Jan 4, 2011

Recently, I had prepared a java applet for my browser. I wanted to know is there somehow I could create a script that could be distributed and the applet could be embedded in any website?

View 4 Replies

Security :: Running A Java Applet In Authenticated Folder

Jul 1, 2010

In one website I am working on we're using a java applet in 2 places: the 1st one in a public area where it works just fine and one in a protected folder where it just doesn't work. The protection is performed with forms authentication. The error is shown below. Any clue ?

java.lang.ClassFormatError: Incompatible magic value 218774561 in class file activeup/activeupload/UploadApplet
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassFormatError: Incompatible magic value 218774561 in class file activeup/activeupload/UploadApplet

View 4 Replies

Configuration :: Java Applet - IIS Web Server Public Folder Doesn't Work Anymore

May 26, 2010

I am trying to write an asp.net webpage which contains an applet. Everything works fine when I run this in a development folder, but when I move it to the IIS web server public folder it doesn't work anymore. I don't get any error message. The browser doesn't repaint the applet area Here is the source code:

//web page
<script src="http://www.java.com/js/deployJava.js"></script>
<script>
var attributes = { code:'ImageApplet.class', archive:'ImageApplet.jar', width:864, height:1000} ;
var parameters = {jnlp_href: 'image-applet.jnlp'} ;
deployJava.runApplet(attributes, parameters, '1.4');
</script>
//applet
public void init() {
buildUI();
}
public void buildUI() {
JButton jumbleButton = new JButton("Jumble");
jumbleButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
};
});
add("South", jumbleButton); }

View 2 Replies

Forms Data Controls :: Printing Girdview Content Used A Java Script

Jul 22, 2010

i m using a grid view with paging. and for printing gird view content i used a java script but when i click the print button it prints only selected page . if their is any way to print all data with no paging in grid view

View 1 Replies

Web Forms :: How To Execute Java Script From VB To Display A PDF File In A New Window

Feb 28, 2011

I want to execute java script from VB to display a PDF file in a new window after a double click event on a listbox and have the following code in Page_Startup:

lbDocuments.Attributes.Add("ondblclick", ClientScript.GetPostBackEventReference(lbDocuments, "ViewDocument"))
If Request("__EVENTARGUMENT") = "ViewDocument" Then
TempString = "~/Resources/" & txtRecordNumber.Text & "/" & lbDocuments.Text
'txtRecordNumber.Text = "ABC123"
'lbDocuments.Text="ABC123 Document 1 (2011-02-22).pdf"
TempString = "<script type=""text/javascript"">window.open('" & TempString & "','_newtab');</script>"
ClientScript.RegisterStartupScript(Me.GetType(), "ViewDocument", TempString, True)
End If

I have tested the above time after time and each double click event registers correctly and the string containing the script (TempString) populates correctly, at least so it appears to me, but the new window is not displayed.

View 7 Replies

Forms Data Controls :: Downloading Pdf Without Prompt Window To Local Computer Then Printing Automatically

Mar 30, 2011

i have two tasks to accomplish. There are several pdf files (invoices) sitting in web server. My tasks are 1) enabling Olga to download multiple invoices into her local computer WITHOUT prompting any dialog box. 2) printing these files then automatically by default local printer from her desktop computer. How is possible this? She has birthday soon. No gift could be better than this solution as she has to open each pdf separately and hit print button about 40 times a day.

View 1 Replies

Java Can Store Procedures As Java .Net Interop

Jul 5, 2010

I'm looking for a way to access a Java API from both a Java console application and an ASP.Net application.In short my Java API exposes a series of methods for dealing with invoices. All of these methods are essentially commands e.g.

GenerateAllInvocies
GenerateInvoiceNumber
PrintAllInvoices
PrintInvoiceNumber

All methods will interact with the database. I had believed Web Services was going to be my means for interop. But I have since been made aware of Java Stored Procedures in Oracle.

View 1 Replies

.Net Application Locks Up?

Dec 16, 2010

We have ASP.Net 2.0 application. It was running corretly and suddenly get loked up, when I kept opened a member edit page for 20 minutes or so. And after 20 minutes when I cliked on save. It is locked. Not it does not let me login. Niether it opens the login page sometimes.This has happened twice.

In hosting server architecture we have two app servers and two db servers for fail over purposes.

View 1 Replies

Forms Data Controls :: Printing Html Code Instead Of Printing Html View In PDF?

Dec 22, 2010

I am using formview control to generate invoice. But instead of printing html view it is printing html code in PDF. I am doing like this:

[Code]....

View 2 Replies

Way To Call Java From A Java Console App

Jul 1, 2010

I got asked to write a java application for my company. I'm a seasoned .Net developer so this is all new ground to me.My task is to produce an invoicing application that has several high level tasks such as:Build single invoiceBuild all invoicesMy company want to be able to call these tasks from a java console application - passing in relevant commands and parameters to invoke the tasks. They also want to be able to invoke the same code from an ASP.NET application.

View 2 Replies

C# - Why Do Nested Locks Not Cause A Deadlock

Feb 17, 2011

Possible Duplicate:
Re-entrant locks in C#

Why does this code not cause a deadlock?

private static readonly object a = new object();
[code]....

View 3 Replies

The Page Occasionally Locks Up Permanently?

Dec 16, 2010

I have a page with the CuteWebUI upload control in it. The page occasionally locks up permanently, and by locks up I mean the whole browser locks up. Does anyone have any problems like this, or can anyone think of a general reason why this would be happening?

View 4 Replies

Iis - 2.0 Small Application Locks Up Until We Run Iisreset?

Nov 1, 2010

I recently developed a simple application for displaying a list of files to some users based on access levels and allowing them to download them etc.

This application was developed to be hosted inside a large corporation with heavy security policies and is fairly mission critical.. The application is very basic,

it checks the users NTID (using windows authentication) compares that to a table in SQL then pulls up a list of all the files on which this user has access Thats pretty much it.. There are also a couple of forms for adding a user and editing a user and uploading a file.

We have a problem often where the application is pretty much unresponsive. This can be remedied by opening command prompt and running 'iisreset' I should also note when originally deploying the application we changed some settings on the server to allow connections to stay open a while longer to allow bigger file uploads.. Could this be locking the application up? I am unabble to restart the server until the weekend. The server is a windows 2003 box running IIS6.0 and .NET 2.0

View 3 Replies

Why Does .Net Locks When Update Code With TortoiseSVN

May 5, 2010

when I update Adobe Flash/Flex code that is not related to ASP.Net with TortoiseSVN (latest) on a Windows Server 2008, the complete website locks and stop responding.Is it ASP.Net recompiling my code, is it IIS 7 or is it Tortoise locking the file system?How can I prevent or minimize this if I need to do an update when 1000 users are using the ASP.Net website?

View 2 Replies

How To Select On A View, Locks The Table Update?

Feb 1, 2010

I have a Web site live and running now. I am using the Subsonic to handle the database connections etc. I am getting time out expired error while updating a table (say Employee). When I check sp_who2, I see the suspended connection for the PID which is updating with a block by anothor pid, so I run the profiler and found out when ever this suspended connection occur, the blocked pid is a select statement on the view (say ActiveEmployees, which is the same as the table but with some where conditions).

View 2 Replies

AJAX Postback Locks Up Controls Inside A TabPanel?

Aug 11, 2010

I am developing a site using VS2008, so I have AJAX 3.5, and the site is meant for using IE8 browser only. I have a TabPanel with 6 tabs, one of them uses controls with postbacks. I had an UpdatePanel outside the TabPanel so the entire panel will perform a refresh on postback. However, the refresh is a little slow so I tried using an UpdatePanel inside the specific tab to refresh only the controls I need updated. It worked, but what ends up happening is the subsequent AJAX controls (I have NumericUpDownExtenders) and tabs become locked (can't click on them). Is this a problem because the Update Panel is already nested inside an AJAX control (TabPanel)? Or is there some other way to go about doing this?

View 1 Replies

AJAX :: Postback Locks Up Controls Inside TabPanel?

Aug 16, 2010

I am developing a site using VS2008, so I have AJAX 3.5, and the site is meant for using IE8 browser only. I have a TabPanel with 6 tabs, one of them uses controls with postbacks. I had an UpdatePanel outside the TabPanel so the entire panel will perform a refresh on postback. However, the refresh is a little slow so I tried using an UpdatePanel inside the specific tab to refresh only the controls I need updated. It worked, but what ends up happening is the subsequent AJAX controls (I have NumericUpDownExtenders) and tabs become locked (can't click on them). Is this a problem because the Update Panel is already nested inside an AJAX control (TabPanel)? Or is there some other way to go about doing this?

View 8 Replies

Web Forms :: Save Http Posted File From Applet

Jun 23, 2010

I am using a third party applet which enables a user to paste a screen shot into it and it posts the file data to an upload page. I am pretty new to asp.net (VB) and wondered if I could use a Generic Handler to read the post data and save the file to disk or just a normal web form to do this? All the examples I have received with the applet are in php of which i have had no experience coming from a Classic ASP background.

View 2 Replies

Web Forms :: Web User Control As An Applet In HTML Page?

Jul 7, 2010

I have a web user control that actually takes a zipcode and based on that brings all the store locations. I am using this contol on couple of places. That works, but I have set of html pages and on one of them I have to setup the same functionality where user inputs zipcode and store locations are displayed to him/her.My question, Can I use that web user control as an applet on my html page without writing html markup and get post methods to achieve the same functionality?

View 1 Replies

MVC :: Printing And Automatic Printing In Mvc?

May 1, 2010

I'm developing an application in which user can decide if he wants to print something now or at some other time. So the idea is for user to click print and say now or determine the time when the document will be printed (without any further user inputs). I don't know what is the best way in asp.net mvc to this. Is there any way to print html in this way or do i have to convert that html in some other format and save it in database?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved