Page 1 of 2 12 LastLast
Results 1 to 20 of 25
Like Tree3Likes

Thread: GUI programming in JAVA

  1. #1
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Lightbulb GUI programming in JAVA

    Drag and dropping controls in C# is quite cool, and upon trying JCreator LE it looks like there is none for JAVA? If I cannot drag and drop controls then does it mean I have to manually type the controls types, their position, etc?

    TIA

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Look into net beans for it's GUI builder functionality.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

    You don't have to 'manually type' the position. Use suitable layout managers.

    db

  4. #4
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    Thank you guys, for sure I will have more questions. =)

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    If you don't understand Swing do not use the GUi builder!
    Especially if you are planning on teaching people Java (as indicated by your previous thread).

    Indeed, do not use a GUI full stop. There is no need for that if you;re doing an OO in Java course.

    And this is precisely why I wrote what I did on that thread...
    Dark likes this.

  6. #6
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    The experiences of those students are all in using consoles so I thought I should introduce to them some GUI, perhaps some basic textboxes and commandbuttons? I prefer that they will learn something that they can use later.

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    So they already know Java?
    If not then you have to teach them Java first, and throwing Swing in really doesn't help.
    If they do, then do not use the GUI builder. That is not a teaching tool for Swing.

  8. #8
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Make sure they know how to find the tutorials. Pick out some good books, and pray they make your job easier by applying themselves.

  9. #9
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    A Gui builder will use components of the Swing library that a person new to Java won't be able to understand. It's not hard to learn how to hand code it all, I'm in the process of doing it myself. I built a notepad clone and a mini midi music player. Both were very fundamental on me learning how Swing works.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  10. #10
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    We have at least 20 3hour meetings, in the midterm (first 10 meetings) we shall be discussing JAVA syntax and OOP, and perhaps on the finals (last 10 meetings) we are going to try using a GUI. Hmmmnnn, I'm even contemplating on using J# so we can just drag and drop. =)

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by dee-u View Post
    We have at least 20 3hour meetings, in the midterm (first 10 meetings) we shall be discussing JAVA syntax and OOP, and perhaps on the finals (last 10 meetings) we are going to try using a GUI. Hmmmnnn, I'm even contemplating on using J# so we can just drag and drop. =)
    There's a nice saying "anything that can be used by monkeys will only be used by monkeys". Better study the basics of the language first and next carefully see and try how an ide may help you in your code writing job. Don't just drag and drop and see what's going to happen and most certainly don't come here afterwards and complain about "Eclipse's strange errors".

    kind regards,

    Jos
    Dark likes this.
    cenosillicaphobia: the fear for an empty beer glass

  12. #12
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    To have a realistic example I am planning on making a simple CRUD program with basic controls, I have been reading on Swing and gui creation now and I will be trying them out as soon as I can. For the database, I haven't done some googling yet. I supposed JAVA can connect to an Access database, is that correct? Will it be difficult doing some Insert, Update, Delete and Select Queries with JAVA?

    Thanks!

  13. #13
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default

    JavaDB (previously known as Derby) comes free with the JDK so why don't you go with that? For Access you'll need some kind of third party JDBC driver or (:shudder:) a JDBC-ODBC connector

    db

  14. #14
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    To be honest, I haven't heard JavaDB or Derby until you mentioned it. =) How about mySql or SQL Server, can Java connect to them?

  15. #15
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Any database that has a JDBC driver (and all the main ones do, as well as all the smaller ones I know of) will connect.
    Derby/JavaDB is the easiest.

  16. #16
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by dee-u View Post
    To be honest, I haven't heard JavaDB or Derby until you mentioned it. =) How about mySql or SQL Server, can Java connect to them?
    Sun bundled it sneakily with their SE distribution, starting from version 1.5 (1.6?), and didn't mention much about it. I also discovered it accidentally (check your directory /Program Files/Sun if you're on a MS Windows machine). It's all there plus splendid, complete documentation. That entire Derby/JavaDB thing surprised me because Sun was officially showing off with their newly bought MySQL database ... Derby/JavaDB is easy and it's fun to work/play with.

    kind regards,

    Jos

    ps. there's more stufff bundled with the SE distribution, there's also a HTTP server available; almost nobody knows it and I don't know what we're supposed to do with it ;-)
    cenosillicaphobia: the fear for an empty beer glass

  17. #17
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    Hmmmnn... Why is it that it looks difficult (compared to VS) to create a GUI with Java?

  18. #18
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by dee-u View Post
    Hmmmnn... Why is it that it looks difficult (compared to VS) to create a GUI with Java?
    Because people want to bend the functionality and visual appearance beyond recognition; all the GUI components have to be capable of doing it; the GUI also has to run cross platform and not all native GUIs (on which Swing more or less depends) are equally cooperative. But if you want to use the GUI stuff in a regular way you can forget about all its dark corners and simply use Swing; it isn't difficult then ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  19. #19
    dee-u is offline Member
    Join Date
    Jun 2011
    Posts
    19
    Rep Power
    0

    Default

    Okay, perhaps it will be appropriate to ask this in this thread: What do you think is the best IDE for GUI development in Java? I only tried JCreator LE so far, I've downloaded Eclipse but haven't tried it yet.

  20. #20
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,776
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by dee-u View Post
    Okay, perhaps it will be appropriate to ask this in this thread: What do you think is the best IDE for GUI development in Java? I only tried JCreator LE so far, I've downloaded Eclipse but haven't tried it yet.
    It doesn't matter much as long as you build your GUIs by hand (as has been said before: NetBean's GUI builder turns out to be a mess in the hands of the unexperienced). Try a simple JFrame first with a few buttons and a few simple LayoutManagers. Your first attempt will take almost forever to complete; but your second and third etc. ones will be easier as your learn and experiment. And above all: read the API documentation for the Swing classes and study Sun's/Oracle's tutorials on the subject. You can't just plunge in and expect to have a great GUI in a couple of hours without the appropriate knowledge.

    kind regards,

    Jos
    sunde887 likes this.
    cenosillicaphobia: the fear for an empty beer glass

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 27
    Last Post: 06-06-2009, 02:09 AM
  2. Replies: 1
    Last Post: 05-31-2009, 11:57 PM
  3. Replies: 1
    Last Post: 05-31-2009, 07:48 PM
  4. Replies: 1
    Last Post: 05-31-2009, 03:17 PM
  5. Replies: 16
    Last Post: 05-28-2009, 04:41 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •