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

Thread: how two create two 8*8 button border

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default how two create two 8*8 button border

    hello everyone
    please help me about this
    http://uploadpic.org/storage/2011/JO...VveTbcXeSf.gif
    i want to create like that
    a page with two button border i need that for battleship game
    but i don't know how create that i don't know what to do i don know use which layout and ..
    i need help quickly


  2. #2
    Junior Member
    Join Date
    May 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: how two create two 8*8 button border

    please help me.

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: how two create two 8*8 button border

    Bumping your topic like that will actually hurt your chances of getting help. People will see that your post has already received a reply and will assume you no longer need their help.

    What have you tried? Where are you stuck? Did you read through the layout tutorial? Lesson: Laying Out Components Within a Container (The Java™ Tutorials > Creating a GUI With JFC/Swing)

    What you should do really depends on what you plan on doing with this grid. You might want to use an individual JComponent for each square, or you might want to use a single JPanel and override paintComponent() to draw the lines. You haven't actually told us what you want to do though, so it's a little hard to give you advice.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. The Following User Says Thank You to KevinWorkman For This Useful Post:

    mr.p4r4d0x (May 26th, 2011)

  5. #4
    Junior Member
    Join Date
    May 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: how two create two 8*8 button border

    Quote Originally Posted by KevinWorkman View Post
    Bumping your topic like that will actually hurt your chances of getting help. People will see that your post has already received a reply and will assume you no longer need their help.

    What have you tried? Where are you stuck? Did you read through the layout tutorial? Lesson: Laying Out Components Within a Container (The Java™ Tutorials > Creating a GUI With JFC/Swing)

    What you should do really depends on what you plan on doing with this grid. You might want to use an individual JComponent for each square, or you might want to use a single JPanel and override paintComponent() to draw the lines. You haven't actually told us what you want to do though, so it's a little hard to give you advice.
    tnx dear
    i want to create battleship game
    its my college project
    can u help me
    i want something like that picture

    visit this picture
    http://uploadpic.org/storage/2011/T3...ZCgQdHFbrT.jpg

  6. #5
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: how two create two 8*8 button border

    First off, read the link in my signature on asking smart questions. For example, many people here don't speak English as a first language, so abbreviations like "tnx" and "u" can be confusing, plus it just makes you look lazy. Also, it's pretty hard to answer "how do I do this" type questions. What have you tried? What worked, what didn't work? How didn't it work? Be specific, post an SSCCE that demonstrates what you've tried, and we'll go from there.

    But just a word of advice: write the game logic before you worry about the GUI. Get everything working on the command line first, before you write a single line of Swing code.

    And once you're ready to write the GUI, give this a careful read-through: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)

    I think what you'll eventually want to do is extend JPanel and override paintComponent() to draw everything. Read also: Painting in AWT and Swing
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Repressable button in GUI
    By Fermen in forum Object Oriented Programming
    Replies: 2
    Last Post: March 1st, 2011, 05:39 PM
  2. Trying to add a close button
    By coyboss in forum Java Theory & Questions
    Replies: 5
    Last Post: February 12th, 2011, 03:28 PM
  3. Please help with Actionlistener-Button
    By ashleykathy in forum AWT / Java Swing
    Replies: 1
    Last Post: March 4th, 2010, 08:21 PM
  4. About Title border in jscrollpane
    By subhvi in forum AWT / Java Swing
    Replies: 2
    Last Post: December 15th, 2009, 12:45 AM
  5. how to create exe jar
    By ttsdinesh in forum Java Theory & Questions
    Replies: 1
    Last Post: September 27th, 2009, 08:21 AM