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
Re: how two create two 8*8 button border
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.
Re: how two create two 8*8 button border
Quote:
Originally Posted by
KevinWorkman
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
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