Estou utilizando o jingloo no eclipse, tenho um JMenuBar, nesse JMenuBar tenho um JMenuItem, no JMenuItem tenho outro JMenuItem dentro dele, eu qeuria que quando passasse o mouse em cima do segundo JMenuItem ele me mostrar as opçoes que vou criar que ser mais dois botoes, mas nao to conseguindo…
[code]package mascarenhas.relatorio.telefonia;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
/**
-
This code was edited or generated using CloudGarden’s Jigloo
-
SWT/Swing GUI Builder, which is free for non-commercial
-
use. If Jigloo is being used commercially (ie, by a corporation,
-
company or business for any purpose whatever) then you
-
should purchase a license for each developer using Jigloo.
-
Please visit www.cloudgarden.com for details.
-
Use of Jigloo implies acceptance of these licensing terms.
-
A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
-
THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
-
LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class View extends javax.swing.JFrame {
private JMenuBar jMenuBar;
private JMenu jMenu1;
private JMenuItem jMenuContrato;/**
- Auto-generated main method to display this JFrame
*/
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
View inst = new View();
inst.setLocationRelativeTo(null);
inst.setVisible(true);
}
});
}
public View() {
super();
initGUI();
}private void initGUI() {
try {
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
this.setFont(new java.awt.Font(“Cooper Black”,0,14));
{
jMenuBar = new JMenuBar();
setJMenuBar(jMenuBar);
{
jMenu1 = new JMenu();
jMenuBar.add(jMenu1);
jMenu1.setText(“Visualizar Contratos”);
jMenu1.setFont(new java.awt.Font(“Comic Sans MS”,1,12));
{
jMenuContrato = new JMenuItem();
jMenu1.add(jMenuContrato);
jMenuContrato.setText(“Contrato 1”);
}
}
}
pack();
this.setSize(337, 308);
} catch (Exception e) {
e.printStackTrace();
}
}/**
- Auto-generated method for setting the popup menu for a component
*/
private void setComponentPopupMenu(final java.awt.Component parent, final javax.swing.JPopupMenu menu) {
parent.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent e) {
if(e.isPopupTrigger())
menu.show(parent, e.getX(), e.getY());
}
public void mouseReleased(java.awt.event.MouseEvent e) {
if(e.isPopupTrigger())
menu.show(parent, e.getX(), e.getY());
}
});
}
- Auto-generated main method to display this JFrame
}
[/code]