Updated display text to be centered

Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
2012-04-05 11:28:57 -04:00
parent 7310444065
commit 45c083beda

View File

@@ -1,5 +1,5 @@
/** /**
* Display.java java * Display.java
* @date Mar 31, 2012 * @date Mar 31, 2012
* @author ricky barrette * @author ricky barrette
* *
@@ -60,7 +60,7 @@ public class Display extends JPanel {
if(mText != null){ if(mText != null){
g.setColor(Color.ORANGE); g.setColor(Color.ORANGE);
g.drawString(mText, this.getWidth() / 2, this.getHeight() /2 ); g.drawString(mText, (this.getWidth() / 2) - ((int) g.getFontMetrics().getStringBounds(mText, g).getWidth() / 2), this.getHeight() /2 );
} }
/* /*