jmenuitem

    3熱度

    2回答

    我在JPopupMenu中遇到了一些圖標和複選框的問題。的複選框和圖標都沒有對準 的項目是像創建: JMenuItem deleteAttributeMenuItem = new JMenuItem(locale.getString("TREE_AttrDelete"), iconDelete); JMenuItem primaryKeyAttributeMenuItem = new JChe

    4熱度

    2回答

    我想用Swing來實現這種類型的菜單。有沒有現成的解決方案(免費和/或商業)?

    0熱度

    2回答

    我在框架中有一個菜單欄和一個選項卡窗格,我希望如果我選擇一個菜單項,那麼請求的選項卡將打開。請幫助我,謝謝!

    1熱度

    1回答

    我已插入背景音樂到使用AudioInputStream我的程序。 當我按下On時,背景音頻將播放,Off將停止播放背景音頻。 這裏是我的代碼爲音頻播放部分的部分: public void playSound(int i) { try { . //Others buttons sound . //Others buttons sound if(

    2熱度

    4回答

    假設我有一個帶有「退出」內的文本的JMenuItem和一個帶有文本「退出」的JButton,其中JButton將使用的命令是System.exit(0), ,當然使用Action Listener,我知道,當點擊JMenuItem時,我可以放置相同的代碼,但是沒有辦法,當我點擊JMenuItem時,JButton被點擊,然後執行下面的命令( JButton命令)?

    1熱度

    3回答

    我想讓我的JMenuBar在GUI中顯示,但它只是在頂部顯示爲1像素行。 這是我的代碼... public LibraryView() { setBounds(100,100,640,480); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLayout(new Bo

    0熱度

    2回答

    JMenuItem具有下面的構造:(來源:GrepCode) public JMenuItem(Action a) { this(); setAction(a); } 然而,當我的代碼有 import javax.swing.*; import java.awt.event.ActionEvent; public class ActionTest extends J

    2熱度

    2回答

    我似乎已經做了一切正確。我只需要實現一個簡單的JMenuBar,但它似乎不起作用。有人能幫我解決嗎? import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMen

    1熱度

    2回答

    我想知道我怎麼可以顯示從這段代碼的輸出... ​​ 我想點擊JMenuItem後在JTextArea打開此在JMenu private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) { //code for Output } 可能有人請幫助我實現這一目標。

    1熱度

    4回答

    我自動生成一組JMenuItem並將它們添加到每個右鍵單擊事件中的JPopUpMenu。問題在於,當我按下所選菜單上的回車鍵時,爲菜單項設置的操作不會運行。我可以使用上/下鍵在菜單上進行導航,但是,只有通過鼠標點擊才能執行該操作。 下面是一段代碼來創建菜單項: private JMenuItem createMenuItem(TaskFactory tf, String title, boolea