Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Mine Sweeper using JOptionPane

 
Trepur La Onse
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am still a beginner in Java and I am quite slow at it. I want to make a simple Java program using the JOptionPane of Mine Sweeper. Can someone give me links that may help me?

Thanks.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

JOptionPane is for asking questions like "Format disk: are you sure? (Yes/No)" and posting messages like "Keyboard error. Please press F1". It's not for doing graphics. You want to use a JFrame and the graphics calls in java.awt.Graphics to draw your game.

Making a game is about a lot more than the graphics, though. For a minesweeper game, you have to have some internal representation of the board, and code for making new random boards. You have to score the user's turns. The graphics are just a small part, really.

There's tons of material on creating GUIs here. The basic stuff about throwing up a window is relevant, and also the stuff about Custom Painting and the Java 2D API. There's a lot to go through.
 
Beware the other head of science - it bites! Nibble on this message:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!