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 4 of 4

Thread: My own version of swing?

  1. #1
    Member
    Join Date
    Feb 2013
    Posts
    78
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default My own version of swing?

    Hi guys! I REALLY want to write myself a complete GUI library, but the thing is.. I dont know how to draw directly to the screen... I can easily draw to a graphics object in a canvas or something like that, but I dont know how to draw a my own frame on the screen without using another frame... I hope im making sense, not really sure how to say it... So, my question is: How do I draw to the screen without using any frame/canvas/panel/etc. so I can draw my own frames and other components? There must be a way since Swing can do it... right?


  2. #2
    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: My own version of swing?

    If I understand you correctly, you will need to rely on native code (eg JNI) - how you do so with native code is OS dependent.

  3. #3
    Member
    Join Date
    Feb 2013
    Posts
    78
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: My own version of swing?

    So, if I want to do this, i will HAVE to code native stuff aswell as java... I cant just use the stuff swing uses somehow? Too much work?

  4. #4
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: My own version of swing?

    Swing uses AWT as it's drawing backend, which is basically what copeg described: it uses native code to draw basic components and stuff. It has been implemented on a large number of platforms because it had quite a large corporate backing (Sun Microsystems, now Oracle and the Java open-source community).

    There is another native backend which I believe IBM wrote called SWT. I've never used it, but it's what Eclipse uses for drawing GUI's.

    Anything lower-level will require you to write the native backend yourself using JNI (keep in mind that the native backend has to be written/compiled on every platform you want to support).

Similar Threads

  1. uploading the java version
    By ball in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 14th, 2013, 01:43 PM
  2. Java Version
    By mohdrazeed in forum Java Theory & Questions
    Replies: 1
    Last Post: July 18th, 2012, 04:28 PM
  3. Java Version
    By mohdrazeed in forum Object Oriented Programming
    Replies: 1
    Last Post: July 16th, 2012, 09:58 AM
  4. HybridJava framework version 1.06 available.
    By Alex68 in forum Web Frameworks
    Replies: 0
    Last Post: April 26th, 2012, 07:20 PM
  5. Version issue? Or what else can it be?
    By SxN in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 17th, 2011, 05:53 PM