久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='WwLiM'></bdo><ul id='WwLiM'></ul>
<i id='WwLiM'><tr id='WwLiM'><dt id='WwLiM'><q id='WwLiM'><span id='WwLiM'><b id='WwLiM'><form id='WwLiM'><ins id='WwLiM'></ins><ul id='WwLiM'></ul><sub id='WwLiM'></sub></form><legend id='WwLiM'></legend><bdo id='WwLiM'><pre id='WwLiM'><center id='WwLiM'></center></pre></bdo></b><th id='WwLiM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WwLiM'><tfoot id='WwLiM'></tfoot><dl id='WwLiM'><fieldset id='WwLiM'></fieldset></dl></div>
  • <tfoot id='WwLiM'></tfoot>

    <small id='WwLiM'></small><noframes id='WwLiM'>

    1. <legend id='WwLiM'><style id='WwLiM'><dir id='WwLiM'><q id='WwLiM'></q></dir></style></legend>

        如何在Java中繪制一個實心圓?

        How to draw a filled circle in Java?(如何在Java中繪制一個實心圓?)

        <i id='UpDa9'><tr id='UpDa9'><dt id='UpDa9'><q id='UpDa9'><span id='UpDa9'><b id='UpDa9'><form id='UpDa9'><ins id='UpDa9'></ins><ul id='UpDa9'></ul><sub id='UpDa9'></sub></form><legend id='UpDa9'></legend><bdo id='UpDa9'><pre id='UpDa9'><center id='UpDa9'></center></pre></bdo></b><th id='UpDa9'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UpDa9'><tfoot id='UpDa9'></tfoot><dl id='UpDa9'><fieldset id='UpDa9'></fieldset></dl></div>

            <tbody id='UpDa9'></tbody>
          <legend id='UpDa9'><style id='UpDa9'><dir id='UpDa9'><q id='UpDa9'></q></dir></style></legend>
              • <bdo id='UpDa9'></bdo><ul id='UpDa9'></ul>
                <tfoot id='UpDa9'></tfoot>

                <small id='UpDa9'></small><noframes id='UpDa9'>

                • 本文介紹了如何在Java中繪制一個實心圓?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個帶有網格布局的 JPanel.在網格的單元格"中,我可以放置不同的元素(例如 JButtons).沒有問題.但現在我想在一些單元格中放置一個實心圓圈.我還想將 ActionListener 與這些圈子聯系起來.更詳細地說,如果我單擊圓圈,它將從當前單元格中消失并出現在另一個單元格中.我怎樣才能在Java中做到這一點?我正在使用 Swing.

                  I have a JPanel with a Grid Layout. In the "cells" of the grid I can put different elements (for example JButtons). There is no problems with that. But now I want to put a filled circle in some of the cells. I also would like to relate an ActionListener with these circles. In more details, if I click the circle it disappears from the current cell and appears in another one. How can I do it in Java? I am using Swing.

                  推薦答案

                  public void paintComponent(Graphics g) {
                     super.paintComponent(g);
                     Graphics2D g2d = (Graphics2D)g;
                     // Assume x, y, and diameter are instance variables.
                     Ellipse2D.Double circle = new Ellipse2D.Double(x, y, diameter, diameter);
                     g2d.fill(circle);
                     ...
                  }
                  

                  這里有一些關于paintComponent 的文檔(鏈接).

                  Here are some docs about paintComponent (link).

                  您應該在 JPanel 中覆蓋該方法并執行類似于上面代碼片段的操作.

                  You should override that method in your JPanel and do something similar to the code snippet above.

                  在您的 ActionListener 中,您應該指定 x, y, diameter 并調用 repaint().

                  In your ActionListener you should specify x, y, diameter and call repaint().

                  這篇關于如何在Java中繪制一個實心圓?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)

                        <small id='OCXSx'></small><noframes id='OCXSx'>

                        <tfoot id='OCXSx'></tfoot>

                          <tbody id='OCXSx'></tbody>
                        <i id='OCXSx'><tr id='OCXSx'><dt id='OCXSx'><q id='OCXSx'><span id='OCXSx'><b id='OCXSx'><form id='OCXSx'><ins id='OCXSx'></ins><ul id='OCXSx'></ul><sub id='OCXSx'></sub></form><legend id='OCXSx'></legend><bdo id='OCXSx'><pre id='OCXSx'><center id='OCXSx'></center></pre></bdo></b><th id='OCXSx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OCXSx'><tfoot id='OCXSx'></tfoot><dl id='OCXSx'><fieldset id='OCXSx'></fieldset></dl></div>
                            <bdo id='OCXSx'></bdo><ul id='OCXSx'></ul>
                          • <legend id='OCXSx'><style id='OCXSx'><dir id='OCXSx'><q id='OCXSx'></q></dir></style></legend>

                          • 主站蜘蛛池模板: 九九热这里 | 国产精品网页 | 不卡在线视频 | 国产福利视频网站 | 国产在线观看一区二区 | 亚洲一区视频在线 | 亚洲精品乱码久久久久久按摩观 | 国产做a爱片久久毛片 | 九九九久久国产免费 | 亚洲一区国产 | 嫩草视频在线 | 97精品超碰一区二区三区 | 成人国产精品一级毛片视频毛片 | 欧美在线资源 | 久久精品国产免费看久久精品 | 91 中文字幕 | 欧美99| 午夜视频精品 | 人人澡视频 | 日韩欧美中文字幕在线观看 | 情侣酒店偷拍一区二区在线播放 | 91精品国产91久久久久久最新 | 欧美综合在线视频 | 黄色大片免费播放 | 中文字幕国产一区 | 午夜精品一区二区三区在线 | 中文字幕亚洲欧美日韩在线不卡 | 狠狠综合网 | 男女爱爱网站 | 国产黄色电影 | 国产伦一区二区三区四区 | 天天天操操操 | 2018国产精品 | 亚洲午夜视频在线观看 | 美女视频黄的 | 日韩一区精品 | 欧美久久综合 | 色婷婷激情综合 | 久久国 | 亚洲欧美在线观看 | 亚洲国产欧美国产综合一区 |