GUI hangs on multiThreaded desktop application

Hello
i have one application which is like eclipse editor, but it can open one file at one time.it directly read file from server machine open it on JTextPane on right side on the event on double click on JTree node on the left side like eclipse.
some time file is too big so it take time to open the file on JTextPane, for i have to use the progressBar that show that openning file is on the way.
So main issue is like:
I used one Thread (ThreadOpen) to open the file on editor, which start an other Thread (ThreadProgress) to show the progressBar for openning the file. if i modify the file then there is event on tool bar to save the file on the server which also start a new Thread (ThreadSave) all is working fine.
but when i try to open a file means start ThreadOpen and if at that time previous file (which was open on the JTextPane) is not saved menas ThreadSave is not started before starting of ThreadOpen, then whole application hangs on ThreadProgess which show the progessBar, i also try without ThreadProgess it also hang the whole GUI.
first I think there may be syncronization issue {color:#ff0000}but whole GUI hangs when there is {color}{color:#ff0000}*NOT* starting of ThreadSave {color}{color:#ff0000}before starting of ThreadOpen if there was an already file open on the JTextPane.{color}
It work fine if save the file first means Start ThreadSave and after it open a file means start of ThreadOpen.
Any idea of Thead working in deep, please help..
Thanks ---
Atul java developer

verma018 wrote:
As i know the dead lock condition raise when there are two or more thread accessing the same resources,
But in my cases as i described earlier when I does not save the file means NOT start ThreadSave before the opening file means start of ThreadOpen, then the whole GUI hangs..
Means there is a compulsion that if there is any file already opened, then it must be saved before opening any other file otherwise GUI will hung up. It is forcing that start ThreadSave first then ThreadOpen if any file already opened.Others have said this, but it sounds like you are calling run() of a method, and not start. Either that or you do have a synchronized method that both threads call.
Kaj

Similar Messages

  • Industry Standard - Desktop Application GUI

    How can i make my desktop application's GUI look the same on different screen resolutions. Would it require me to change the screen resolution when the app is loaded (it is being deployed from JWS)? Or is there a better way? Im not too keen on changing the screen resolution (if its possible) because some screens change shape and all kinda weird things haha
    Question is what is the most commonly used method of making the GUI layout appear similar in different resolutions?
    Thanks in advance, Nick!

    TuringPest wrote:
    Depends if this is a personal project. An employer might have a preference.
    Otherwise, sure use the IDE if it saves you time. It wouldnt hurt to learn some basic GUI skills though.++
    I like Netbeans' gui editor. It's just like any other IDE feature, it saves you time by doing the routine things for you. Creating a new JFrame is like using a boilerplate template for a class, dragging components around is like refactoring your code. And just like any other feature, if you don't understand the code underneath the editor, it's much less useful. I've never created any gui with it (at least any that was worth mentioning) that didn't require tweaking of the code after the editor's work was done.

  • Developing desktop applications for windows

    Hello
    I am currently doing a final year project which is an encryption software for the company that i did my placement with. i have done the core part of the program but i need to know how to make it look professional. i need to be able to have it as an installable desktop application (Only for Windows), with an icon provided by me which is used when files are encrypted using the application. i have no idea how to achieve this effect and i seek knowledge.
    thanks in advance for your help

    There are many levels of professional software in my opinion. There is software that works, meets the requirements and doesn't crash. That's professional in the sense that it does what it is supposed to and does it well. People pay for that even if its green-screen non-GUI based. TONS of stuff still working/written for non-GUI environments and plenty pay for it.
    When related to Java and desktop applications, I feel there is only truly one real way to brag you have written a professional software suite. That is when your application not only adheres to what it should do, but provides a means to extend it without having to wait for major releases, and the UI is VERY consistent, not cluttered, not tons of buttons/menus/dialogs/windows all over the place and the underlying coce of the app is truly written well to make good use of areas of Java such as resources (properly closing files when not using them, returning DB connections when done, using WeakReference of nulling out refs to objects no longer needed). It is very very easy to cause a memory leak in a java application if you do not watch at all times for object refs that are left hanging.
    By extensibility, I mean providing some means of plugging in new pieces of code to enhance the product or fix existing issues (bugs) and providing a simple update facility that can either auto-update, or allow an install to add the update.
    It is exactly these reasons that keep me plugging away on my plugin engine (www.sourceforge.net/projects/genpluginengine) and UI framework built around plugins. While the engine is almost done and is very similar to the Eclipse plugin engine, the UI framework will be ongoing for some time. Making a very professional read-to-run-out-of-the-box free/open-source framework built on high-quality well tested plugins is not easy to accomplish with a couple hours a week and only me and one other doing it. I would love to get more help shortly, adding tons of great features that all developers could benefit from, and soon I will start asking various java boards for help, see if anyone is interested in contributing. The goal is a professional looking, solid underlying code, well/highly tested UI framework that can be used by anyone to quickly build their specifics and not worry about the more common UI application stuff such as file i/o choosers, help, preferences, authentication, access levels/rights, views and editors, and more. With a 3rd project working to add tons of Swing UI components, the final UI framework will provide a number of high-quality components like rounded/shaded/gradient filled panels with shadowing, calendar/date pickers, wizards, and more, again all highly tested to ensure ultimate quality.
    If you are interested, feel free to post back to this response with email, or join up at the above mentioned sourceforge project and start contributing to the mail list.

  • Need help on making desktop application to web application having individual controls for users at the same time

    Hi,
    I have an desktop application and the following are the functionalities of the same.
    1. User inputs the data file with path (log file) to parse the required data.
    2. Once the user enters the path and starts the tool with start button, the tool parse the required data in terms of records and gives the records (creates output file containing all the useful records).
    3. Have popup window to display a group of data.
    4. Have popup to Plot graph. When a button is pressed in main GUI, the popup is opened giving scroll bar menus to choose the data for the graph. User after selecting the data (multiple Y axis) press another button to plot the graph. The input to this popup is the output file generated by this tool.
    5. The main GUI has buttons (play, step forward, step backward, reverse play, pause, stop, 1st record, last record - like tape recorder buttons) to play the records one by one.
    This application is used by many people and since its a desktop application (created in labview 2009), the user every time has to manually install the newer version.
    "So it is required to make the application into web based so that, the user can individually access the tool at the same time (different instances same as desktop app) and run their own data files from their system. The output files to be stored in the respective user's system."
    Can this be done using Web Publishing or Web Services present in LabView?
    I tried using Web Publishing but it gives control to only one user at a time and loading the files from the client path to run the tool is not possible.

    Simple. 
    If all you are worried about are updates, just put the EXE on a shared network drive and have your users launch it from there.

  • Access to local file system for desktop application

    As a .NET and VBA developer/user, I have found Flash to be a
    great RAD development solution for certain desktop app. projects...
    if only actionscript could access the local file system and talk to
    local (preferably non-XML) data-sources!
    I'm not familiar with the latest version of Flash CS3 &
    Actionscript 3.0
    Is there any reliable way Flash CS3 can be programmed to access
    the user's local file system - that is, as a stand-alone desktop
    application????

    Thanks for the response.
    I hope Adobe catches a clue ... with Microsoft's Windows
    Presentation Framework and the new ability of easily implementing
    Flash-like animation on .NET apps, Adobe is going to have to get
    busy. Stand-alone desktop apps still rule (as opposed to web-based)
    in the business world, and they are driven by data. If Flash was
    capable of easily talking to local data-sources (Access, Excel,
    Text etc.), it could significantly increase its adoption as a
    widely used business RAD tool. The Flash IDE is great and rivals
    any Microsoft RAD IDE + users love the slick Flash GUIs.

  • RMI service not working only inside desktop application creatd in netbeans

    Actually I have made an RMI service which works just fine inside a normal java application which I have created in netbeans 6.1, now the problem aries when I put this code inside a desktop application creatd in netbeans 6.1, see the code below, when I use this code in desktop application creatd in netbeans 6.1 the application hangs at the line as shown below;
    String[] list = registry.list();
    well I do not no why it just hangs there and after three or for minutes it returns with some error, I have shown the error in the end. What it seems to me that inside desktop application creatd in netbeans 6.1 the application can not get registry.list() or registry list.
    try
    registry = LocateRegistry.getRegistry(serverAddress, 1099);
    String[] list = registry.list();
    if( list == null )
                        throw new RemoteException( "list == null" );
    else
    for (int k=0; k < list.length; k++)
    System.out.println("registry" + k + ": " + list[k].toString());
    System.getProperties().setProperty("java.security.policy", "wideopen.policy");
    // Create and install a security manager
    if(System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());
    rmiServer = (ReceiveNodeInterface)(registry.lookup("RMIServiceToSendNodesHierarchy"));
    String text = "Please, send us the root node.";
    rootNode = rmiServer.getRootNode(text);
    treeModel = new DefaultTreeModel( rootNode );
    jTreeOPCservers.setModel(treeModel);
    catch(RemoteException e){
    e.printStackTrace();
    catch(NotBoundException e){
    e.printStackTrace();
    the error is ;
    java.rmi.ConnectIOException: Exception creating connection to: 192.168.1.142; nested exception is:
    java.net.SocketException: Connection reset
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:614)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
    at sun.rmi.registry.RegistryImpl_Stub.list(Unknown Source)
    at tagbrowser.TagBrowser.getRootNodeIntoTree(TagBrowser.java:198)
    at tagbrowser.TagBrowser.<init>(TagBrowser.java:83)
    at desktopapplication1.DesktopApplication1View.MyAction(DesktopApplication1View.java:217)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    No I am sure that I am not starting the RMI Registry with socket factories at the server. Next I am sure that the RMI Registry is running. Infect as I have said in the start that I have made an RMI service which works just fine inside a normal java application which I have created in netbeans 6.0.1 the problem aries when I put this code inside a desktop application creatd in netbeans 6.0.1 or 6.5 both.

  • Issues in using JPA in Desktop Application

    Hi, I have some doubts in certain issues. For my desktop application, I have 4 manager class, which includes all logic codings in it and serve different area in the application, with each using an entity manager. It seems to me that creating an entity manager to each manager class is a bad design. Is there any other ways that could allow me to share the same entity manager? Or a better design that I dont know of? Thanks!

    Hi Vishnu,
    There is no solution for this, you cannot have GUI interactions(nor any statements that might invoke a implicit/explicit commit) in a V2 update. When you say this worked, did you have update debugging enabled, if so then it might have worked as the debugger session can access GUI...
    If the whole idea/need of this output is to download a file, use OPEN DATASET, TRANSFER and CLOSE DATASET.
    Even for the RSNAST00 execution, i am sure that in the actual business scenario(in production) this would be scheduled as a background job, where in again "GUI_DOWNLOAD" wouldn't work.
    Regards,
    Chen

  • Creative Cloud desktop application using CreativeCloudSet-Up does not download.

    I am trying to instal Creative Cloud desktop application, i downloaded the CreativeCloudSet-Up, it starts but it freezes and does not download the application. What to do?

    Re: Premiere Pro is downloading now... Not moving just hanging Check my page I had the same issue try the link out of my post it worked for me.   Hit correct answer if it works so I know is not just me.

  • How to distribute/sell Java database desktop application ?

    Hi,
    I have developed a java desktop application(it is a kind of knowledgebase program) which uses mysql as a database, everything runs fine but I would like to know that how shall I distribute or sell my program.
    My questions in short:
    How to create a "Setup.exe" for your java desktop application which also has a database?
    How to publish/distribute my database with my java application?
    My Questions in detail:
    I mean I want to create a "setup.exe" which users can download and then install it by providing the destination path(like any other program).
    I also want users to add/edit data to the database by using the program's GUI, so my question is how will users be able to do that because obviously not everyone has a mysql database and service running on their computer and how should I provide the database with my program, should I provide the database file, but in that case anyone can access my database directly(by copying my database file to his mysql database folder), right ?
    I am a beginner programmer hence I need a lot of guidance and advice, please give me all links, examples, articles etc, I am willing to read it all !
    Thanks everyone.

    rjhm_86 wrote:
    How to create a "Setup.exe" for your java desktop application which also has a database?
    Use Java Webstart.
    How to publish/distribute my database with my java application?
    My Questions in detail:
    I mean I want to create a "setup.exe" which users can download and then install it by providing the destination path(like any other program).
    I also want users to add/edit data to the database by using the program's GUI, so my question is how will users be able to do that because obviously not everyone has a mysql database and service running on their computer and how should I provide the database with my program, should I provide the database file,.. Is the DB meant to be editable?
    Use any of a number of installers to install the DB, invoked from a webstart ExtensionInstallerService. Store the installation path using the Webstart PersistenceService (PS). Your app. will query the PS to get the path to the DB, start it, and go from there..
    I have demos of the ExtensionInstallerService and PersistenceService on my site.
    ....but in that case anyone can access my database directly(by copying my database file to his mysql database folder), right ?If you give a DB to me, it's mine, buddy. Don't start this foolishness how the user might steal your data. If the data is so valuable, hide it behind a web service at your site and never actually give it to the end user. But really, your best protection in the case the DB data is distributed, is an EULA.
    I am a beginner programmer hence I need a lot of guidance and advice, please give me all links, examples, articles etc, I am willing to read it all !Please give me cash. Deployment is the 'last 1%' of a project that consumes 10% of the time. Getting a good deployment is not a beginner topic and you will need to do a lot of searching & research and go through many trials and errors before you are done.
    Thanks everyone.No worries.

  • GUI Hangs

    For more than a year the GUI on my iMac (27-inch Late 2009) has hung once or twice every day.  The mouse remains responsive and the arrow cursor moves about the screen but nothing is clickable or selectable and the menu clock stops . The only way out is to hold down the power button and restart.
    I've had Macs for 20 years and can usually solve my problems but this has me stumped. I can't reproduce the issue and there appears to be no particular culprit, it happens regardless of what applications are running and there is nothing consistent or of note in the Console logs.  I have doubled RAM to 8GB, upgraded with a clean instal from 10.8 to 10.9 (running 10.9.5 now) run first aid, disabled third party extensions (only running Flash Player, Java and MySQL now).
    Any ideas, short of another clean instal?

    Thanks Mike. 
    It looks like A Better Finder was the culprit.  I thought I had disabled this from the system preference pane but it seems it was still loading.  I upgraded to the latest version six days ago and have not had a GUI hang since! 
    Very happy this is unlikely to be hardware! 

  • Client side validation in J2SE (Desktop applications)

    Hi,
    I am new to J2SE(desktop applications). I created a GUI screen with the help of Swing. I would like to add some client-side validation to my GUI e.g Required field validator, regular expression validator etc. Can you please provide me with some sample code?
    Regards,
    ap.

    Regular Expressions - http://java.sun.com/docs/books/tutorial/essential/regex/
    For required fields, just don't allow the user to continue unless getText() on the field returns appropriate data.

  • I seek a java forms builder for desktop applications

    can any body help me find a forms builder for desktop applications using Swing?
    i know Oracle Forms developer, but i think it is restricted to JSP projects only .. isn't it?

    Any IDE with a GUI builder will do. Not that I actually advice to create GUIs (I guess this is what you mean by form) with tools... but if you want to, that's the way. The editor of JBuilder is said to be quite good.

  • Desktop applications

    It seems like Windows 10 somewhat "acknowledge" that there are still desktop application users around.
    Windows 8 and 8.1 was less so.
    The main problem was not really the Metro (oops, I mean Modern) GUI (pure desktop apps, even older works just fine), but the statements from Microsoft regarding the future of WPF and other .Net technologies, even Silverlight and perhaps .Net platform as
    a whole.
    It seems like Microsoft has realized that a huge number of users are still running desktop applications on their W8.1, W8, W7, Vista and XP machines and that Windows 10 is partly a continuation of that line (where 8 and 8.1 had some sidesteps which
    were not exactly welcomed commonly).
    This leads to my questions regarding future desktop application development:
    Will WPF be revitalized and further developed ?
    Will "something better" take over for WPF ?
    Will technologies like Entity Framework be further developed ?
    Other bits (like WCF, WWF, Prism, ASP.NET etc.)
    Will .Net it self be further developed ? and the languages, particularly C# ? (even if the languages are not really part of .Net)
    The real question boils down to:
    Should I trust that developing desktop applications by .Net technologies mentioned above and which work on old OS's as well as the newest and future is a safe investment (providing users still want them) ? Or will e.g. WPF see the same faith as Silverlight
    I know it is early, but anyway important for both users and developers to plan for their future and I wish Microsoft could be more open with these kind of Roadmaps (which I think we all deserve)

    Also, our apps are running on many XP's, several hundreds Windows 7 and soon Windows 8 and probably Win 10 after it's release.
    Store apps cannot run on the older OS's before Windows 8.
    Given your requirements, the answer must be to stick with what works
    for you today - Win32. MS aren't going to be able to kill it, too many
    critical pieces of software use it.
    So again, anyone knows something about MS future plans regarding desktop application development for older and newer OS's ?
    No, and I suspect MS don't really know which way to turn either.
    Dave

  • JavaFx Script for Development of Enterprise Desktop Applications?

    Hi,
    we are currentlich developing a rather complex business application using Swing. Now the JavaFx stuff seems to get up to speed and we are thinking about changing to build the Gui based on JavaFX.
    The enterprise frontend would be a more or less full-screen application, with many masks to enter data into. The backend is a glassfish bean architecture based on WebServices.
    Is it now the time to go that way? I dont see any usable design applications to integrate many Swing components - and JavaFx Components seems not existing to support all that listbox, treeviews, keyboard focusing stuff I need here...
    I am not very happy about coding all the dialoges per hand as it seems to be the way now...
    What do you guys suggest? Skip it for now? Or go the hard way as an early adoptor to find all the bugs and problems we somehow managed to get working already in Swing?
    Regards

    Hi,
    I've been trying to write a new desktop application using JavaFX and its pretty tough going with what's available in the API at the moment. The 1.0 release is obviously focused more on RIA, which is perfectly understandable considering the market space they are trying to enter and the fact that if you want to write a desktop application you can always use Swing. I think right now it would be suicide to recommend to your employers that you switch to JavaFX.
    The main problem is that JavaFX does not currently have all the standard components you would expect to be able to choose from in order to capture and display data. However, there is always the option of taking whatever Swing component you want to use (e.g. JTree) and wrapping it in the JavaFX SwingComponent class. There are some good examples of how to do that on this wiki page: [http://jfx.wikia.com/wiki/SwingComponents] . But my feeling is, if you're going to build your application out of Swing components wrapped in JavaFX classes then you might as well just write the application in Swing.
    I think that right now its too early for JavaFX enterprise desktops but I do believe that one day they will supersede Swing. JavaFX has so much potential. It will eventually be able to do everything Swing can do and then so much more. And I think Sun will have to start focusing on the desktop market quite soon. They are competing with Flex in the RIA space but Flex has good support for data tables etc and I see a lot of projects going with Flex when they might have otherwise gone with Swing.
    Cheers,
    Kevin

  • Java button or gui to sit on desktop to launch

    I am looking for a way to put a Java button or gui to sit on desktop and run/launch a program

    Your question is a little bit to open.
    If you want an icon then I sugest you pack your application into a jar file, create a short cut an running it from there.
    However iit is a complete different story is what you want is a button that sits on your desktop and when it is clicked it opens a new window (which I think it is your application).
    In that case you would have to create another application itself. Create a Jframe (remove the border) and then add a JButton to it. When user clicks on the button (use button action) open the new window (by createing a new instance)
    Hope I understood you well!

Maybe you are looking for

  • Problems with Deployment Overview  in Support Portal pages

    Hi gurus, I am facing a problem or maybe it is more a doubt: When I launch the report for Deployment Overview  in the support page in the portal , I can see that I have a lot of components that are not installed but they are in the repository. First

  • Can't read a text file using java

    Hi All I am trying to read a log file. ProgramA keeps updating the log file, while my program ProgramB reads it. For some readson my ProgramB is not able to read the last two lines in the log file. If I run the program in debug mode it is reading all

  • Still having trouble with iTunes movie rental

    Running a Mac w/iTunes 7.6. It brought down the whole movie, but just as it's about to finish, I get an error that says "We could not complete your iTunes store request. An unknown error occured (5103). There was an error in the iTunes Store. Please

  • Default settings in InvoView

    When I logi as a regular user to InfoView, by default the fist page shows me the following: Document List My Favourites My Inbox Information OnDemand Services Help Is it possible to change this so that certain users in a CMC group will go to the InBo

  • Regular expressions for xml parsing

    I have a xml parsing problem that I have to solve using regular expressions. It's not possible for me to use a different method other than regular expression. But there is a problem that I cannot seem to rap my head around. I want to extract the cont