Results 1 to 14 of 14
Like Tree3Likes
  • 1 Post By KevinWorkman
  • 1 Post By gimbal2
  • 1 Post By KevinWorkman

Thread: Using self-designed textfields in a client or program?

  1. #1
    MR bruto's Avatar
    MR bruto is offline Senior Member
    Join Date
    May 2013
    Location
    The Netherlands
    Posts
    130
    Rep Power
    0

    Default Using self-designed textfields in a client or program?

    So what im wondering is how i use textfields that i designed myself, maybe with unity.

    Let's say you create a really nice textField for an MMORPG, how would i actually make it able to be typed in?

    Because it's basically a sprite what you're using, and i totally have no clue about how to actually let it act as a textfield.

    Any help is welcome, thank you :).

    i mean textfields and password fields as in this client:

    http://i42.tinypic.com/2laqarr.png
    Never give up.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: Using self-designed textfields in a client or program?

    Is this a Java question?

    As far as I know, you won't be able to just import it. But JTextFields can be customized however you want, so it should be pretty easy to recreate whatever you did in Unity in Java.

    Or are you asking how to create a text field in Unity?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    MR bruto's Avatar
    MR bruto is offline Senior Member
    Join Date
    May 2013
    Location
    The Netherlands
    Posts
    130
    Rep Power
    0

    Default Re: Using self-designed textfields in a client or program?

    Quote Originally Posted by KevinWorkman View Post
    Is this a Java question?

    As far as I know, you won't be able to just import it. But JTextFields can be customized however you want, so it should be pretty easy to recreate whatever you did in Unity in Java.

    Or are you asking how to create a text field in Unity?
    Nope, im asking how i would be able to implement a textfield designed by myself into my java program. and actually let it act as a textfield.
    Because if you look at that client, that's obviously not a regular JTextField. That's a textfield designed by someone.
    So how can i make a self-designed textfield work?
    Never give up.

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: Using self-designed textfields in a client or program?

    Check out the API. Components have methods that let you set the background, the border, etc. You could even set your own L&F or extend the component itself to provide custom behavior.
    MR bruto likes this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,030
    Rep Power
    6

    Default Re: Using self-designed textfields in a client or program?

    Quote Originally Posted by MR bruto View Post
    Because if you look at that client, that's obviously not a regular JTextField. That's a textfield designed by someone.
    Yes but you don't know what technology is used to create the text field. It looks like that is a game using some sort of graphics API (LWJGL, JOGL, LibGDX) for the 'game' part, so the text fields may just be 100% custom programmed, or a game GUI framework with skinning capabilities is used.
    MR bruto likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    MR bruto's Avatar
    MR bruto is offline Senior Member
    Join Date
    May 2013
    Location
    The Netherlands
    Posts
    130
    Rep Power
    0

    Default Re: Using self-designed textfields in a client or program?

    Thanks guys, i think this will help me out.
    Never give up.

  7. #7
    MR bruto's Avatar
    MR bruto is offline Senior Member
    Join Date
    May 2013
    Location
    The Netherlands
    Posts
    130
    Rep Power
    0

    Default Re: Using self-designed textfields in a client or program?

    Never mind, i still don't have a solution :/
    Never give up.

  8. #8
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: Using self-designed textfields in a client or program?

    Quote Originally Posted by MR bruto View Post
    Never mind, i still don't have a solution :/
    Then ask a specific technical question. What have you tried? Where are you stuck? What are you confused about?
    DarrylBurke likes this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  9. #9
    MR bruto's Avatar
    MR bruto is offline Senior Member
    Join Date
    May 2013
    Location
    The Netherlands
    Posts
    130
    Rep Power
    0

    Default Re: Using self-designed textfields in a client or program?

    Quote Originally Posted by KevinWorkman View Post
    Then ask a specific technical question. What have you tried? Where are you stuck? What are you confused about?
    I haven't tried anything.
    i'm just confused about how i can actually type in a self-designed sprite textbox.
    I see people making just textfields for clients that they can type usernames in, and i want to try it out.

    If this isn't specific enough then i might as well bury myself
    Never give up.

  10. #10
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,030
    Rep Power
    6

    Default Re: Using self-designed textfields in a client or program?

    and i want to try it out
    Yes but... WHERE? A Swing / JavaFX application? Is this going to be part of a game you plan to build and if so - how were you thinking to build that game, using which technology? Java is only a hammer you know, you need to draw a plan before you can get stuff done.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  11. #11
    MR bruto's Avatar
    MR bruto is offline Senior Member
    Join Date
    May 2013
    Location
    The Netherlands
    Posts
    130
    Rep Power
    0

    Default Re: Using self-designed textfields in a client or program?

    Quote Originally Posted by gimbal2 View Post
    Yes but... WHERE? A Swing / JavaFX application? Is this going to be part of a game you plan to build and if so - how were you thinking to build that game, using which technology? Java is only a hammer you know, you need to draw a plan before you can get stuff done.

    I'm making a calculation application for a game, using swing.
    And i actually want nice textfields instead of the default ones
    Never give up.

  12. #12
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: Using self-designed textfields in a client or program?

    So, do you have an example program (in the form of an SSCCE) that displays a single text field? Have you tried to customize the text field in that application?

    You keep telling us what you want to do, but not what you've tried. What exactly is confusing you?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  13. #13
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,030
    Rep Power
    6

    Default Re: Using self-designed textfields in a client or program?

    Well then reply #4 is indeed the answer. But you don't "just" do it, it requires research, work and a decent knowledge of the Swing API.

    Note that JavaFX might actually be easier in this case, since it has specific styling features.

    http://docs.oracle.com/javafx/2/css_...s_tutorial.htm
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  14. #14
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,965
    Rep Power
    8

    Default Re: Using self-designed textfields in a client or program?

    Quote Originally Posted by gimbal2 View Post
    Note that JavaFX might actually be easier in this case, since it has specific styling features.
    It's also the way of the future for frontend Java stuff. Sigh, guess I have to sit down and learn it one of these days...
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Replies: 6
    Last Post: 01-09-2012, 09:30 PM
  2. Using my own-designed buttons & textboxes
    By tagger in forum AWT / Swing
    Replies: 2
    Last Post: 04-01-2011, 03:45 AM
  3. Replies: 0
    Last Post: 08-29-2009, 09:12 AM

Posting Permissions

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