Find Jobs
Hire Freelancers

Java Swing Scrollable JPopupMenu Rewuired

$15-20 USD

Cancelado
Publicado hace alrededor de 17 años

$15-20 USD

Pagado a la entrega
need a scrollable JPopupMenu as the menuitems are sometimes so many that they exceed the screen space and would not be visible. I need a way to scroll through the menu items to avoid this visibility problem.. I have a word document which I am uploading which has all the details as to what I require. [login to view URL] Please note that this is an urgent requirement and I need it by Sunday ## Deliverables I have developed an application which requires a Scrollable JPopupMenu. Reason for the requirement I need a scrollable JPopupMenu as the menuitems are sometimes so many that they exceed the screen space and would not be visible. I need a way to scroll through the menu items to avoid this visibility problem. What I have implemented I have implemented a Scrollable JPopupMenu which contains JButtons as menuitems. This solves my scrolling issue but I have many other problems. My Project requires the addition of JCheckBoxMenuItems to check and uncheck the menuitems each time the user clicks on the item. My Code 1. [login to view URL] import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; public class ScrollablePopupMenu extends JPopupMenu { private static final long serialVersionUID = 1; private JPanel panelMenus = null; private JScrollPane scroll = null; public ScrollablePopupMenu(GraphicsConfiguration gc) { super(); scroll = new JScrollPane(); panelMenus = new JPanel(); [login to view URL](new GridLayout(0,1)); [login to view URL](panelMenus); [login to view URL](null); [login to view URL](new Dimension([login to view URL]().width, [login to view URL]().getScreenSize().height - [login to view URL]().getScreenInsets(gc).top - [login to view URL]().getScreenInsets(gc).bottom - 4)); [login to view URL](scroll); } public void show(Component invoker, int x, int y) { [login to view URL](); [login to view URL](); int maxsize = [login to view URL]().height; int realsize = [login to view URL]().height; int sizescroll = 0; if (maxsize < realsize) { sizescroll = [login to view URL]().getPreferredSize().width; } [login to view URL](new Dimension( [login to view URL]().width + sizescroll, [login to view URL]().height)); [login to view URL](invoker, x, y); } public void add(JButton menuItem) { [login to view URL](menuItem); } public JMenuItem add(JMenuItem menuItem) { [login to view URL](menuItem); return menuItem; } public void addSeparator() { [login to view URL](new JSeparator()); } } 2. [login to view URL] import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; public class JFramePopupMenu extends JFrame { private static final long serialVersionUID = 1; private JPanel jContentPane = null; private JButton jbnPopup = null; private JTextField jtfNumOfMenus = null; private JLabel lblNumElem = null; private JButton getBtnPopup() { if (jbnPopup == null) { jbnPopup = new JButton(); [login to view URL]("View Popup"); [login to view URL](new ActionListener() { public void actionPerformed(ActionEvent e) { ScrollablePopupMenu scrollablePopupMenu = new ScrollablePopupMenu([login to view URL]()); int n = [login to view URL](getTxtNumElem().getText()); for (int i=0;i ## Platform Windows, Java JDK 1.5
ID del proyecto: 2833437

Información sobre el proyecto

Proyecto remoto
Activo hace 17 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos

Sobre este cliente

Bandera de INDIA
Bangalore, India
4,5
1
Miembro desde ago 9, 2006

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.