Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Java to realize Chinese Chess Game

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "how to use Java to achieve Chinese chess games". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

I. Interface

The chess board should first be prepared, which is an interface of the right size, the right proportion and the right position, and then draw (yes, drawLine's) n lines and slashes on the form, the specific value is set according to the size of your interface. The interface drawn in this way is neat and looks good.

Public void paint (Graphics g) {super.paint (g); / / rewrite the drawing function Font f=new Font( "Microsoft Yahei", Font.BOLD,30); g.setFont (f); g.drawRect (60,50,500,560); / / Outer ring g.drawRect (70,60,480,540); / / Inner ring / / horizontal line part int length=60 For (int iTuno Bandi)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report