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

<legend id='PApMM'><style id='PApMM'><dir id='PApMM'><q id='PApMM'></q></dir></style></legend>

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

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

    1. <tfoot id='PApMM'></tfoot>

        • <bdo id='PApMM'></bdo><ul id='PApMM'></ul>

        java中的GUI“轉(zhuǎn)到上一個/下一個"選項?

        GUI in java quot;go to previous/nextquot; option?(java中的GUI“轉(zhuǎn)到上一個/下一個選項?)
          • <bdo id='AGhc5'></bdo><ul id='AGhc5'></ul>

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

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

                  <tbody id='AGhc5'></tbody>
                <legend id='AGhc5'><style id='AGhc5'><dir id='AGhc5'><q id='AGhc5'></q></dir></style></legend>
                • 本文介紹了java中的GUI“轉(zhuǎn)到上一個/下一個"選項?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  有沒有辦法可以選擇轉(zhuǎn)到上一個消息對話框或下一個?我有一個程序,在完成所有輸入和數(shù)學計算后,會出現(xiàn)一個消息對話框,其中包含Person 1"的信息,然后按確定"并出現(xiàn)Person 2"的信息.如果有一個選項可以在不同的對話框之間導航,那就太好了.這是打印消息的程序部分.

                  Is there a way to have an option to go the a previous message dialog box or a next one? I have a program where after all the input and math calculations is done, a message dialog box appears with the information for "Person 1" then you press ok and the one for "Person 2" appears. It would be nice if there could be an option to be able to navigate between the different dialog boxes. Here is the part of the program that prints the messages.

                  for (i = 0; i < NumEmployees; i++)    
                  {
                      JOptionPane.showMessageDialog(null, 
                              "Employee: " + names[i] + "
                  " + 
                              "ID: " + data[i][0] + "
                  " + 
                              "Hours worked: " + (data[i][1] + data[i][2]) + "
                  " + 
                              "Overtime: " + data[i][2] + "hours" + "
                  " + 
                              "Amount earned: " + payment[i]);    
                  }
                  

                  推薦答案

                  使用 Action 將功能和狀態(tài)從組件中分離出來."在下面的示例中,操作將 indexupdate()List 更改為 JLabel.您的應(yīng)用程序可能會從 List<Employee> 更新 JTextArea.

                  Use Action "to separate functionality and state from a component." In the example below, the actions change the index and update() a JLabel from a List<String>. Your application might update a JTextArea from a List<Employee>.

                  package gui;
                  
                  import java.awt.BorderLayout;
                  import java.awt.EventQueue;
                  import java.awt.event.ActionEvent;
                  import java.util.ArrayList;
                  import java.util.Arrays;
                  import java.util.List;
                  import javax.swing.AbstractAction;
                  import javax.swing.JButton;
                  import javax.swing.JFrame;
                  import javax.swing.JLabel;
                  
                  /**
                   * @see http://stackoverflow.com/a/20116944/230513
                   */
                  public class PrevNext {
                  
                      private final List<String> list = new ArrayList<>(
                          Arrays.asList("Alpher", "Bethe", "Gamow", "Dirac", "Einstein"));
                      private int index = list.indexOf("Einstein");
                      private final JLabel label = new JLabel(list.get(index), JLabel.CENTER);
                  
                      private void display() {
                          JFrame f = new JFrame("PrevNext");
                          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                          f.add(new JButton(new AbstractAction("<Prev") {
                  
                              @Override
                              public void actionPerformed(ActionEvent e) {
                                  if (--index < 0) {
                                      index = list.size() - 1;
                                  }
                                  update();
                              }
                          }), BorderLayout.LINE_START);
                          f.add(label);
                          f.add(new JButton(new AbstractAction("Next>") {
                  
                              @Override
                              public void actionPerformed(ActionEvent e) {
                                  if (++index == list.size()) {
                                      index = 0;
                                  }
                                  update();
                              }
                          }), BorderLayout.LINE_END);
                          f.pack();
                          f.setLocationRelativeTo(null);
                          f.setVisible(true);
                      }
                  
                      private void update() {
                          label.setText(list.get(index));
                      }
                  
                      public static void main(String[] args) {
                          EventQueue.invokeLater(new Runnable() {
                  
                              @Override
                              public void run() {
                                  new PrevNext().display();
                              }
                          });
                      }
                  }
                  

                  這篇關(guān)于java中的GUI“轉(zhuǎn)到上一個/下一個"選項?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

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

                    1. <small id='il18K'></small><noframes id='il18K'>

                          <tbody id='il18K'></tbody>

                          <legend id='il18K'><style id='il18K'><dir id='il18K'><q id='il18K'></q></dir></style></legend>
                        1. <tfoot id='il18K'></tfoot>
                            <bdo id='il18K'></bdo><ul id='il18K'></ul>
                            主站蜘蛛池模板: 久久久国产一区二区三区 | 99r在线 | 日韩高清www| 久久久久久国产精品 | 四虎最新地址 | 久久久久亚洲精品国产 | 日本福利一区 | 日韩另类视频 | 中文字幕成人av | 91视频三区 | 成年女人免费v片 | 中文字幕在线视频免费观看 | 日韩三区| 91久久久久久久 | 中文字幕人成乱码在线观看 | 一区二区三区精品 | 亚洲高清视频在线观看 | 日韩综合 | 成人在线一区二区三区 | 国产96色在线 | 亚洲国产小视频 | 日韩福利| 色爱综合网| 91精品久久久久久久久 | 亚洲国产精品成人综合久久久 | 91爱啪啪 | 国产黄色在线观看 | 女朋友的闺蜜3韩国三级 | 美女黄视频网站 | 国产午夜亚洲精品不卡 | 国产精品视频综合 | 国产精品精品视频 | 高清一区二区三区 | 福利片在线观看 | 国产欧美一区二区三区日本久久久 | 成人免费看电影 | 国产精品久久久久久久久免费相片 | 91精品入口蜜桃 | 成人一区二 | 中国av在线免费观看 | 97精品国产|