Jnlpdownloadservlet exception downloading jars of a certain size

Using
Windows XP
Weblogic 10.3.2
Java 1.6.0_17
An exception occurs when downloading jars for the first time with the jnlpdownloadservlet. It occurs for the two largest jars only.
from the JnlpDownloadServlet log -
JnlpDownloadServlet(3): Request: /netintel-client/application/jviewsall.5.0.jar
JnlpDownloadServlet(3): User-Agent: JNLP/6.0 javaws/1.6.0_17 (b04) Java/1.6.0_17
JnlpDownloadServlet(3): Resource returned: /application/jviewsall.5.0.jar
JnlpDownloadServlet(1): Internal error:
java.net.SocketException: Software caused connection abort: socket write error
     at java.net.SocketOutputStream.socketWrite0(Native Method)
     at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
     at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
     at weblogic.servlet.internal.ChunkOutput.writeChunkNoTransfer(ChunkOutput.java:530)
     at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:487)
     at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
     at weblogic.servlet.internal.ChunkOutput$2.checkForFlush(ChunkOutput.java:580)
     at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:306)
     at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:150)
     at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:138)
     at jnlp.sample.servlet.DownloadResponse$FileDownloadResponse.sendRespond(DownloadResponse.java:231)
     at jnlp.sample.servlet.JnlpDownloadServlet.handleRequest(JnlpDownloadServlet.java:178)
     at jnlp.sample.servlet.JnlpDownloadServlet.doGet(JnlpDownloadServlet.java:113)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3594)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
The weblogic log -
<17-Feb-2010 11:56:43 o'clock GMT> <Error> <HTTP> <BEA-101020> <[ServletContext@27407197[app:network-intell
ient spec-version:null]] Servlet failed with Exception
java.lang.IllegalStateException: Response already committed
at weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletResponseImpl.java:1591)
at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:614)
at weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:592)
at jnlp.sample.servlet.JnlpDownloadServlet.handleRequest(JnlpDownloadServlet.java:191)
at jnlp.sample.servlet.JnlpDownloadServlet.doGet(JnlpDownloadServlet.java:113)
Truncated. see log file for complete stacktrace
JNLP as follows
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0"
codebase="http://localhost:7001/netintel-client/application"
href="launch.jnlp">
<information>
<title>Oracle Communications Network Intelligence</title>
<vendor>Oracle Corporation.</vendor>
<description>Oracle Communications Network Intelligence</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-Xmx1024m -Xverify:none -Xfuture"/>
<property name="log4j.configuration" value="log4j-modules.properties"/>
<property name="APP_SERVER_URL" value="http://localhost:7001"/>
<property name="user.language" value="en"/>
<property name="user.country" value="ie"/>
<jar href="NetIntelligence_Help_en.jar"/>
<jar href="acegi-security-1.1-SNAPSHOT.jar"/>
<jar href="acegi-security-tiger-1.0.3.jar"/>
<jar href="aspectjweaver-1.5.2.jar"/>
<jar href="spring-aspects.jar"/>
<jar href="spring-modules-validation-0.5.jar"/>
<jar href="spring.jar"/>
<jar href="hibernate3.jar"/>
<jar href="antlr-2.7.6.jar"/>
<jar href="asm-attrs.jar"/>
<jar href="asm.jar"/>
<jar href="cglib-2.1.3.jar"/>
<jar href="ehcache-1.2.3.jar"/>
<jar href="jta.jar"/>
<jar href="dom4j-1.6.1.jar"/>
<jar href="jcalendar-flib-apache.jar"/>
<jar href="jhall.jar"/>
<jar href="joda-time-1.4.jar"/>
<jar href="commons-attributes-api.jar"/>
<jar href="commons-attributes-compiler.jar"/>
<jar href="commons-beanutils.jar"/>
<jar href="commons-codec-1.3.jar"/>
<jar href="commons-collections.jar"/>
<jar href="commons-dbcp.jar"/>
<jar href="commons-digester.jar"/>
<jar href="commons-fileupload.jar"/>
<jar href="commons-httpclient-3.0.1.jar"/>
<jar href="commons-io-1.3.1.jar"/>
<jar href="commons-lang.jar"/>
<jar href="commons-logging-1.1.jar"/>
<jar href="commons-pool.jar"/>
<jar href="commons-validator.jar"/>
<jar href="log4j-1.2.11.jar"/>
<jar href="binding-1.1.1.jar"/>
<jar href="forms-1.0.6.jar"/>
<jar href="looks-2.1.1.jar"/>
<jar href="xstream-1.2.jar"/>
<jar href="netsure_ui.jar"/>
<jar href="netsure_business.jar"/>
<jar href="netsure_domain.jar"/>
<jar href="netsure_common.jar"/>
<jar href="jviewsall.5.0.jar "/>
<jar href="netsure_modules.jar" main="true"/>
</resources>
<application-desc main-class="com.netsure.capman.app.AppMain"/>
</jnlp>
jviewsall.5.0.jar is 3830371 bytes
netsure_modules.jar is 3802341 bytes
None of the other jars raise this exception
The next largest jar is 2846594 bytes
The 2 jars still download ok and there are no apparent problems.
Has anyone encountered anything similiar ?
I am aware of an old thread forum http://forums.sun.com/thread.jspa?forumID=38&threadID=183571 concerning the download of updated files . This was last updated in 2007

Thanks Andrew,
I updated the invalid syntax identified by both these tools - namely adding an association mime-type jnlp and moving the properies to the bottom of the resources. Unfortunately the same exception occurs.
This was not an issue using Java 1.5 with weblogic 9.2
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0"
codebase="http://localhost:7001/netintel-client/application"
href="launch.jnlp">
<information>
<title>Oracle Communications Network Intelligence</title>
<vendor>Oracle Corporation.</vendor>
<description>Oracle Communications Network Intelligence</description>
<association mime-type="application/x-java-jnlp-file" extensions="jnlp"/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-Xmx1024m -Xverify:none -Xfuture"/>
<jar href="NetIntelligence_Help_en.jar"/>
<jar href="acegi-security-1.1-SNAPSHOT.jar"/>
<jar href="acegi-security-tiger-1.0.3.jar"/>
<jar href="aspectjweaver-1.5.2.jar"/>
<jar href="spring-aspects.jar"/>
<jar href="spring-modules-validation-0.5.jar"/>
<jar href="spring.jar"/>
<jar href="hibernate3.jar"/>
<jar href="antlr-2.7.6.jar"/>
<jar href="asm-attrs.jar"/>
<jar href="asm.jar"/>
<jar href="cglib-2.1.3.jar"/>
<jar href="ehcache-1.2.3.jar"/>
<jar href="jta.jar"/>
<jar href="dom4j-1.6.1.jar"/>
<jar href="jcalendar-flib-apache.jar"/>
<jar href="jhall.jar"/>
<jar href="joda-time-1.4.jar"/>
<jar href="commons-attributes-api.jar"/>
<jar href="commons-attributes-compiler.jar"/>
<jar href="commons-beanutils.jar"/>
<jar href="commons-codec-1.3.jar"/>
<jar href="commons-collections.jar"/>
<jar href="commons-dbcp.jar"/>
<jar href="commons-digester.jar"/>
<jar href="commons-fileupload.jar"/>
<jar href="commons-httpclient-3.0.1.jar"/>
<jar href="commons-io-1.3.1.jar"/>
<jar href="commons-lang.jar"/>
<jar href="commons-logging-1.1.jar"/>
<jar href="commons-pool.jar"/>
<jar href="commons-validator.jar"/>
<jar href="jviewsall.5.0.jar"/>
<jar href="log4j-1.2.11.jar"/>
<jar href="binding-1.1.1.jar"/>
<jar href="forms-1.0.6.jar"/>
<jar href="looks-2.1.1.jar"/>
<jar href="xstream-1.2.jar"/>
<jar href="netsure_ui.jar"/>
<jar href="netsure_business.jar"/>
<jar href="netsure_domain.jar"/>
<jar href="netsure_common.jar"/>
<jar href="netsure_modules.jar" main="true"/>
<property name="log4j.configuration" value="log4j-modules.properties"/>
<property name="APP_SERVER_URL" value="http://localhost:7001"/>
<property name="user.language" value="en"/>
<property name="user.country" value="ie"/>
</resources>
<application-desc main-class="com.netsure.capman.app.AppMain"/>
</jnlp>

Similar Messages

  • Getting Exception in JWS while downloading jar files from server

    Hi All,
    I am running JWS on j2re1.4.2_10(build 03). while JWS is trying to download jar files from web server, I am getting the following Exception.
    All the jar files are signed. Any idea ?
    JNLPException[category: Download Error : Exception: null : LaunchDesc: null ]
         at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source)
         at com.sun.javaws.cache.DownloadProtocol.getDownloadSize(Unknown Source)
         at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
         at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
         at com.sun.javaws.Launcher.downloadResources(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    Are you able to download your *.jar files directly from server
    For example say,
    http://127.0.0.1:8080/test/testme.jarIf yes,
    Then problem should be with your *.jnlp file. Check all your *.jar with respect to context location of your url from where you are downloading *.jnlp file

  • Quicktime trailer could only download a certain size

    Hi, when i try to view a trailer from quicktime.com/trailers, when i click on the HD format, 480p(36MB), it would only download 7 secs of the trailer, when i click on the standard medium, it would only download 25 secs of the trailer, & standard small, it would only download 45 secs of the trailer. It seems like the quicktime could only download a 'fixed' amount of size. i went to quicktime preferences >advanced & change the cache from 100MB to 313MB, & 'OK' the changes, but the results are still exactly the same, even after PC is restarted. When i removed my new hard disk & put back the old hard disk, i could view all complete trailers, even when the Quicktime 'cache' settings are still 100 MB. Please help. Thanks

    No, QuickTime is only 32-bit on Windows systems. (It runs on the Windows-on-Windows-64 subsystem on 64-bit systems.)

  • Error in downloading jars through jnlp from Oracle 10.1.3 App Server

    I am working on migrating an application (containing two WARs) from Resin servlet server to Oracle 10.1.3 App Server. The migration was unit tested successfully. One of the WARs was implemented as a web service that downloaded JARs to the client PC through jnlp. When I tried to combine the two WARs into one (application) WAR, some of the JARs failed to download with an error message stating that they were "corrupted". 5 of the 6 "corrupted" contain native code, although two other native code JARs were able to download successfully.
    Most of the time the jnlp failure was accompanied with this error: WARNING: Exception returned by remote server: {0}
    javax.naming.NoPermissionException: Not allowed to look up java:comp/ServerAdministrator, check the namespace-access tag setting in orion-application.xml for details
         at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:819)
         at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:283)
         at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:242)
         at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:224)
         at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:152)
         at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:127)
         at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
         at java.lang.Thread.run(Thread.java:595)
    Error: Unexpected error during lookup : Lookup error: javax.naming.NoPermissionException: Not allowed to look up java:comp/ServerAdministrator, check the namespace-access tag setting in orion-application.xml for details; nested exception is:
         javax.naming.NoPermissionException: Not allowed to look up java:comp/ServerAdministrator, check the namespace-access tag setting in orion-application.xml for details
    Why is the jnlp failing when the WARs are part of the (main) application, but OK when it is part of a web service WAR? How can I overcome this problem?
    Thanks for your help.

    Hi Marc ,
    Thanks for your reply.....
    Did you mentioning the script (upgrade_10131_
    10133_oracle.sql) in the orabpel. I had run this script after applying the patch.
    Still iam facing the same issue.
    what need to be done?
    Could you please help me on this, because I need to do the Fault Handling Framework in BPEL and so i need the faultpolicy folder to be present.
    Since I got the folder by applying the patch, but what happend is when i try to check out for the activity status in the BPEL Console Activity tab it is showing the error as mentioned earlier. Any problem with patch implementation or any bug is there. So far i done the patch installation successfully without error and i upgraded the orabpel schema using the mentioned script also. Any other things i need to do?
    Regards,
    Ashok.

  • Error while downloading Jar/Jad by air

    Hi All,
    I am using netbeans as my IDE while compiling I m getting Jar and Jad file only I have uploaded both the files to VPN server now I want to download Jar/Jad file yesterday it downloaded fine on worked well on Blackberry bold device but from today it started creating a problem & display error messages as *"in jad file descriptor missing for midlet 1"*
    So while downloading it says download fail
    My Jad file information is given below
    MIDlet-1: myproject, , myproject
    MIDlet-Jar-Size: 6335
    MIDlet-Jar-URL: myproject.jar
    MIDlet-Name: myproject
    MIDlet-Vendor: vendor
    MIDlet-Version: 2.1
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0
    Please tell me it works fine on simulator but not on my device

    Try writing the complete url for your jar file location and make sure the jar size is exactly the same.
    Ex.:
    MIDlet-1: myproject, , myproject
    MIDlet-Jar-Size: *6335*
    MIDlet-Jar-URL: http://www.myserver.com/ota/myproject.jar
    MIDlet-Name: myproject
    MIDlet-Vendor: vendor
    MIDlet-Version: 2.1
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0

  • Where the javaws stores downloaded jar files?

    I met problem to start jnlp file in command line. System shows me error like "file system is full". So, I wonder where the javaws stores downloaded jar file. And how can I change it to an available directory. Thank you.

    >
    I met problem to start jnlp file in command line. System shows me error like "file system is full". So, I wonder where the javaws stores downloaded jar file. And how can I change it to an available directory. >- Open the [Java Control Panel|http://java.sun.com/docs/books/tutorial/information/player.jnlp].
    <if necessary>
    - Close the application viewer/Change to the 'General' tab
    </if necessary>
    - Click the Temporary Internet Files 'Settings' button.
    - Click the 'Change' button to move the cache, and follow the prompts
    Of course, in that same dialog are controls for changing the compression level, and adjusting the maximum size, of the JWS cache - you are probably better off trying that first.

  • App logo says "loading", I get a message that it a certain size, go to itun

    I was downloading an app on my iPad and I got a message saying it is (more than a certain size...which I can't remember) and that I should go to iTunes. The logo for the app is shaded and it says Loading under it. I want to delete that app or app logo. I tried the normal way to delete an app and although that logo wiggled, it doesn't have an X on it so I can't delete it that way. I tried shutting down my iPad and turning it back on and it didn't go away. How do I get rid of this? I'm not a whiz with technical stuff so the more simpler the lingo the better. Thanks.

    From previous posts it sounds like you are trying to download it via 3G. There is a 2MB limit for 3G downloads from iTunes/App Store. The only way to delete it is to download it on your computer, sync with the computer and then delete the app from you iPad like normal.

  • ( j2me ) download jar "invalid application"

    I have a problem!!!
    When downloading my Jar via bluetooth to my SonyEricsson T610 everything works just fine. But when I try to load it from a wml-page on the Internet, it looks like it is downloaded ok, but when the downloading is finished it say "Invalid application". I'm all out of ideas! PLEAS HELP!
    My Jad file (ShootingRange.jad):
    MIDlet-Name: ShootingRange
    MIDlet-Version: 0.9
    MIDlet-Vendor: temp se
    MicroEdition-Profile: MIDP-1.0
    MicroEdition-Configuration: CLDC-1.0
    MIDlet-Jar-URL: http://www.temp.se/ShootingRange.jar
    MIDlet-Jar-Size: 36041
    MIDlet-1: ShootingRange, , ShootingRange.ShootingRange
    The size on the Jar-file (OS XP):
    Size: 35,1 KB (36?041 bytes)
    Size on disk: 36,0 KB (36?864 bytes)
    My wml-file:
    <?xml version="1.0"?>
    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <wml>
    <head><meta http-equiv="Cache-Control" content="max-age=30" forua="true" /></head>
    <card id="card0" title="ShootingR...">
    <do type="prev" label="Back"><prev/></do>
    <p>ShootingRange is a time limited shooting range game. ShootingRange is free to download and play.
    </p>
    <p>Download now!</p>
    </card>
    </wml>

    I had the same problem and finaly solved it!
    Apache Webserver associates jar-files with the content-type "application/x-java-archive" by default. This is not wrong, but some cellphones, like my T610, insist of getting a "application/java-archive".
    To be on the safe side, you should create a .htaccess-file with the following content:
    AddType .wml text/vnd.wap.wml
    AddType .jad text/vnd.sun.j2me.app-descriptor
    AddType .jar application/java-archive

  • How can i keep zoomed in a certain size different sites without having to zoom in every time each site?

    when i open Firefox, the size of the letters is small and i can't see well. i zoom in a certain size, but when i open a new site the letters return to their previous size.. how can i preserve a certain size off letters without having to do the same thing (zoom in ) every time i open a new site? the analysis at my laptop is 1920*1080..

    The Firefox [https://support.mozilla.com/en-US/kb/Page+Zoom Page Zoom] feature does a domain by domain level of saving the users preferred zoom level settings, there is no default Page Zoom level setting in Firefox, as with some other browsers.
    Try the Default FullZoom Level extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/6965
    Or the NoSquint extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/2592/

  • I can't download the apps with big size like need for spees, but in apps with normal size(less than 100KB)there is no problem,is there any body who can help me?

    I can't download the apps with big size like need for spees

    Have a little patience. 4 minutes is only a short time for someone to find your post and reply to it. Also clicking on "This Solved My Problem" marks your problem as solved so many folks that may otherwise help will pass the question by since it is "solved."
    I suggest you start a new question that gives a good title to a specific problem. Then in the body of the thread describe the problem in detail, tell us what steps you have tried so far to correct the problem, what happened, and what error messages you received.

  • Accessing a file in the downloaded jar

    Is it possible for an applet to access a file in a downloaded jar file?
    In other words, the applet class and say a text file are placed in a jar file on the server. Once the jar file is donwload and the applet is started, can the applet read data from the text file in the jar?

    This URL should help you solve your problem.
    http://developer.java.sun.com/developer/qow/archive/76/index.html
    Have a nice day.
    nathan

  • Location of downloaded .jar files?

    When I was using the java in the jre package, downloaded .jar files would go to ~/.java  I have switched to the openjdk6 package and I have no idea where downloaded .jar files go now... it seems as though they are cached in memory and not saved to disk at all.  Are they saved somewhere?

    openjdk and jre don't do the same.
    openjdk is a jdk (Java Development Kit) and jre is Java Runtime Environment.
    And the files should be downloaded into your download directory which you've either set manually or is maybe $HOME/Download.

  • Cursor changes to X shape at certain sizes

    I currently am running Photoshop CS6 on Windows 7. When I am using the Brush or Pencil tools, sometimes the Cursor will change to a curved X shape. This appears to happen at certain sizes (between 65px to250px) and then goes back to the normal circle shape when larger or smaller. The brush itself paints normally but there are times where I need to know exactly what areas it is going to color. I am using the default brushes, no custom ones.
    I have attached a picture of what the cursor looks like when it changes:
    How do I make it so that this does not occur?

    How are your Photoshop cursor settings set and does this happen for all brush types tips etc,

  • Restrict window size reduction up to a certain size

    Hi,
    I didn't know how to search for this, hence sorry if it has been answered before.
    My question is not about window resizing which is easy via
    setResizable() method.
    I 've noticed that some complex dialog boxes do not allow to descrease their size after a specified value. See e.g., JBuilder's Project Properties dialog box; you can increase its size as much as you want, but when you try to reduce its size, after a certain size it isn't reducing any more.
    How can you do that? Is it something that has to do with JWindow or with the layout it's using (GridBagLayout I guess)?
    Thanks in advance.
    John.

    I was very fustrated with that problem so I came up with a "solution". I never actually needed that kind of feature but the very idea that it wasn't available in the api bothered me.
    I probably shoud be shot for that but here goes :import javax.swing.*;
    import javax.swing.event.MouseInputListener;
    import java.awt.*;
    import java.awt.event.*;
    * <dl>
    * <dt><b> Creation date :</b></dt>
    * <dd> 22 nov. 2004 </dd>
    * </dl>
    * @author Pierre LE LANNIC
    public class MinimumSizedDialog {
         private Dimension theMinimumSize;
         private JDialog theDialog;
         private class ResizePanel extends JPanel implements MouseInputListener {
              private int theDirection;
              private Point theFirstPoint;
              private Dimension theStartDragDimension;
              private Cursor thePreviousCursor;
              private Cursor theResizeCursor;
              public ResizePanel(int direction) {
                   super();
                   theDirection = direction;
                   // for debug purposes only
                   setOpaque(true);
                   setBackground(Color.RED);
                   addMouseListener(this);
                   addMouseMotionListener(this);
                   switch(theDirection) {
                        case SwingConstants.EAST :
                             theResizeCursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
                             break;
                        case SwingConstants.SOUTH :
                             theResizeCursor = Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR);
                             break;
              public Dimension getPreferredSize() {
                   Dimension dim = super.getPreferredSize();
                   Dimension pref = dim;
                   // width / height should be 2 . 10 is just to make the panel more obvious.
                   switch(theDirection) {
                        case SwingConstants.EAST :
                             pref = new Dimension(10, dim.height);
                             break;
                        case SwingConstants.SOUTH :
                             pref = new Dimension(dim.width, 10);
                             break;
                   return pref;
              public void mouseClicked(MouseEvent e) {}
              public void mouseEntered(MouseEvent e) {
                   thePreviousCursor = getCursor();
                   setCursor(theResizeCursor);
              public void mouseExited(MouseEvent e) {
                   if (thePreviousCursor != null) {
                        setCursor(thePreviousCursor);
                        thePreviousCursor = null;
              public void mousePressed(MouseEvent e) {
                   theFirstPoint = getPointOnScreen(e.getPoint());
                   theStartDragDimension = theDialog.getSize();
              public void mouseReleased(MouseEvent e) {}
              public void mouseDragged(MouseEvent e) {
                   Point current = getPointOnScreen(e.getPoint());
                   switch(theDirection) {
                        case SwingConstants.EAST :
                             horizontalResize(current);
                             break;
                        case SwingConstants.SOUTH :
                             verticalResize(current);
                             break;
              public void mouseMoved(MouseEvent e) {}
              private void horizontalResize(Point aNewPoint) {
                   int diff = aNewPoint.x - theFirstPoint.x;
                   final Dimension newDim = new Dimension(theStartDragDimension.width + diff,
                                                                   theStartDragDimension.height);
                   if (validateDimension(newDim)) {
                        theDialog.setSize(newDim);
                        theDialog.validate();
              private void verticalResize(Point aNewPoint) {
                   int diff = aNewPoint.y - theFirstPoint.y;
                   Dimension newDim = new Dimension(theStartDragDimension.width,
                                                            theStartDragDimension.height + diff);
                   if (validateDimension(newDim)) {
                        theDialog.setSize(newDim);
                        theDialog.validate();
              private Point getPointOnScreen(Point aPoint) {
                   Point p = new Point(aPoint);
                   SwingUtilities.convertPointToScreen(p, ResizePanel.this);
                   return p;
         public MinimumSizedDialog(Frame anOwner, Container aUserContentPane, Dimension aMinimumSize) {
              theDialog = new JDialog(anOwner, MinimumSizedDialog.class.getName(), true);
              theDialog.setResizable(false);
              final JPanel parentContentPane = new JPanel(new BorderLayout());
              parentContentPane.add(new ResizePanel(SwingConstants.EAST), BorderLayout.EAST);
              parentContentPane.add(new ResizePanel(SwingConstants.SOUTH), BorderLayout.SOUTH);
              parentContentPane.add(aUserContentPane, BorderLayout.CENTER);
              theDialog.setContentPane(parentContentPane);
              theMinimumSize = aMinimumSize;
         public JDialog getDialog() {
              return theDialog;
         private boolean validateDimension(Dimension aDimension) {
              if (aDimension.width < theMinimumSize.width) return false;
              if (aDimension.height < theMinimumSize.height) return false;
              return true;
         private static void test() {
              final JFrame frame = new JFrame(MinimumSizedDialog.class.getName());
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JButton launchButton = new JButton("showDialog");
              frame.setContentPane(launchButton);
              JPanel panel = new JPanel();
              panel.setPreferredSize(new Dimension(500, 500));
              final JDialog testDialog = new MinimumSizedDialog(frame, panel, new Dimension(300, 300)).getDialog();
              launchButton.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        testDialog.pack();
                        testDialog.setVisible(true);
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        frame.pack();
                        frame.show();
         public static void main(String[] args) {
              test();
    }As you can see, there is still a LOT of room for improvement. I just hope it might help somebody out there.

  • Download jar only when it is used

    Hello,
    I have an applet that uses some jar files, is it possible download the jar file only when it is called by the applet?
    Thanks,
    Pati

    If you add an index file in the first jar file on the
    applet's class path, the Java Plug-in downloads jar
    file only when necessary.
    You can find more information at:
    http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Index
    Regards

Maybe you are looking for

  • LR export to Photoshop - won't send as a PSD!

    When I select a CR2 file and choose to "edit in adobe photoshop CS3..." the image opens in CS3 (with no dialogue box to ask if I want to edit a copy of original, etc.). It won't open as a JPEG or PSD file. The filename on the opened PS file ends in .

  • Problem in saving the outline.

    Hi i'm running with a problem. i have deleted the members of a dimension in my outline and now i'm loading it again by build files. when i am trying to save my outline it displays "Unable to complete reading from outline. Out of memory". can anyone t

  • Icons in system tray

    on a non wired desktop pc, windows xp. sp2, I want to clean out the system tray of unneeded icon(programs)running there. I have: Linksys Router BEFW1154 adapter WUSB11Ver2.6 cable modem BEFCMU10  v.3 In the non wired computers system tray there are 2

  • How to turn off laptop screen....

    when my PB is connected to my Plasma and how do I get the sound through my amp/speakers? Help appreciated. Cheers

  • Pr. Pro. CS5 and QuickTime

    I am truly frustrated with the software. I have up dated both adobe yesterday and Nvidia Quadro 5,000. When I send my projext to encore it says ithas faile to initialize QuickTime. I have read much of the threads but haven't seen a solution. Is there