Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Help in GUI development

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help in GUI development

    I have a set of complex SQLs which generate information from the various spatial and non-spatial layers. The database is Postgres 9.2 with PostGIS on Windows 7 O/s. I would like to package the SQLs into a GUI based entity rather than the user having to type out at command line. In short, press a button and at backend, a set of SQLs will run in Postgres and generate the information - mostly the output is a jpg file. How do I start and what are the tools i need? Thanx in advance.


  2. #2

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Help in GUI development

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

  4. #4
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help in GUI development

    Looked at all of these. But could not get an answer. Kindly note that i need to develop a GUI which would run complex SQLs in Postgres. Currently the SQLs are run from command line / PGAdmin.

  5. #5
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Help in GUI development

    Your initial question is very broad - hence the reason I linked to those tutorials. If they didn't answer your question, then perhaps refining the question by breaking it down into more specific parts would help. The tutorial for creating a GUI demonstrates how to create a GUI - did you try to create one using this tutorial? What happened? The tutorial for JDBC describes how to make database queries - did you try to connect to your database using JDBC?

  6. #6
    Junior Member
    Join Date
    Apr 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help in GUI development

    Thank you for your reply. Here is my problem dissected.

    1. I use remote sensing images along with ancillary data like rainfall, temperature, vegetation map etc.
    2. The various layers are accessed by SQLs (entered as long commands) currently and outputs are generated as text files / tables / images (jpg format).
    3. Sometimes there can be conditional statements
    e.g. if the rainfall is within a range (user defined) and under a particular vector (administrative unit), then vegetation could be of some type.
    4. Currently I am using Postgres as database to store images, ancillary data and running SQLs and PostGIS to handle raster and vector data.
    5. If the tool has to be handed over to someone who has minimal idea of writing SQLs, one cannot derive any useful information from the data.
    6. It is planned to build multiple scenarios for the data and give to the user a GUI.
    7. By clicking the GUI, at the backend a SQL will be executed and user gets the output.
    e.g. a button on GUI would be <Get NDVI> This would run an appropriate SQL at the backend and return the value to the user.
    if another button is <Generate Map> The appropriate SQL would be executed (can have conditional and/or nested statements) and user would have an output image.

    Yes, JDBC is connected. I also attempted at writing the SQLs into java code. This works for simple SQLs (one line statements), but not for nested / conditional SQLs. Swing does help in GUI development, but how do we execute the SQLs. Rather how do we attach buttons on the GUI with the SQLs so that they execute smoothly.

    I hope I am clear now.

  7. #7
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Help in GUI development

    but how do we execute the SQLs. Rather how do we attach buttons on the GUI with the SQLs so that they execute smoothly.
    To respond to actions, selections, etc...register the appropriate listener to perform any tasks - in the case of a JButton register an ActionListener: How to Write an Action Listener (The Java™ Tutorials > Creating a GUI With JFC/Swing > Writing Event Listeners)

    I also attempted at writing the SQLs into java code. This works for simple SQLs (one line statements), but not for nested / conditional SQLs.
    Issues are hard/impossible to diagnose without knowing what you mean by this. Does the code compile? Are exception's thrown at runtime? Does it misbehave?

Similar Threads

  1. Java Enterprise Development(J2EE) or Java Android Development?
    By gokhan47 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 1st, 2013, 08:27 PM
  2. Development
    By kittu in forum Java Theory & Questions
    Replies: 2
    Last Post: October 11th, 2012, 04:28 PM
  3. Replies: 3
    Last Post: February 1st, 2010, 12:24 AM