domingo, 22 de septiembre de 2013

Menús Con Java Swing

Ya vimos los componentes atómicos y los componentes de Texto, ahora es el turno para conocer los componentes de Menús que nos provee Java Swing...

Seguiremos con la estructura de los últimos artículos, veremos unas definiciones generales y al final se presentará una aplicación de ejemplo usando estos componentes.


Que Son?

Todos debemos conocer lo que es un Menú, los que estamos en este campo a diario debemos interactuar con algún tipo de menú que nos brinda opciones que queremos realizar, un editor de texto, una ventana, un navegador etc, todos deben tener un Menú desde el cual administrar nuestro sistema....

Cuales Son?

Java Swing nos provee ciertos componentes para crear una barra de Menú, en ella podemos combinar diferentes elementos con un mismo fin, proveer las opciones necesarias para trabajar con el sistema....Veamos

JMenuBar.
Es el elemento principal cuando vamos a crear menús, ya que provee la barra donde se alojaran cada uno de los items u opciones deseadas.
barraMenu = new JMenuBar();
barraMenu.add(menuArchivo);
setJMenuBar(barraMenu);

JMenu.
Si bien el elemento anterior permite crear una Barra donde alojar el resto de componentes, el JMenu es quien contiene dichos componentes, a este se le agregan el resto de opciones, podemos asociarlo con un contenedor el cual aloja otros elementos como botones, etiquetas, campos entre otros...... el JMenu permite agregar los elementos o items correspondientes, así como otros JMenus.....
menuArchivo = new JMenu();
menuArchivo.add(menuItemNuevo);   
menuArchivo.addSeparator();

JMenuItem.
Representan Items u opciones del menú, cuando creamos un JMenu decimos que tipo de opciones puede contener y al crear un JMenuItem decimos cuales son las opciones para ese menú en especifico, por ejemplo el Menú "Archivo", contendrá los items "Abrir", "Guardar", "Nuevo", "Principal", etc....
menuItemNuevo = new JMenuItem();
menuItemNuevo.setText("Nuevo");
menuArchivo.add(menuItemNuevo); 


JCheckBoxMenuItem.
Este compontes es otro item que almacena el JMenu, permite vincular casillas de  verificación o Checkbox, muy útil cuando vamos a parametrizar mas de una opción o característica de nuestro sistema...
jCheckMenu1 = new JCheckBoxMenuItem("Check1");
menuOpciones.add(jCheckMenu1);

JRadioButtonMenuItem.
Este componente es similar al anterior, la diferencia es que permite vincular  componentes RadioButton los cuales brindan opciones de selección única, por ejemplo si en un editor de texto queremos un único tipo de letra, podemos usar este componente....
jRadioButtonMenu1 = new JRadioButtonMenuItem("Radio1");
grupoRadios.add(jRadioButtonMenu1);
menuOpciones.add(jRadioButtonMenu1);

JPopupMenu.
Por ultimo tenemos el JPopupMenu, a diferencia de los anteriores, este componente no es contenido en la Barra de Menú, sino que se asocia al contenedor principal que para nuestro ejemplo es un JPanel (del cual hablaremos en el siguiente articulo), permite brindar opciones emergentes o popup con tan solo dar click derecho sobre algún área del panel....... el JPopup funciona también como un contenedor similar al JMenu....
menuEmergente = new JPopupMenu();
itemEmergente1.setText("Opcion Emergente 1");
menuEmergente.add(itemEmergente1)


El Ejemplo.

En este ejemplo agrupamos los componentes anteriores, la única función es dar a conocer lo básico de estos elementos.


Nuevamente resalto el hecho de que se brinda una idea general de cada componente, mas no un ejemplo a profundidad, eso lo dejamos para próximas entradas.....

Descarga.

Como es costumbre en el enlace de descarga se encuentra el archivo .rar con la aplicación, solo es cuestión de descomprimir y abrir con Eclipse pero si usas NetBeans te interesará esta entrada con un vídeo paso a paso de como abrirlo en el.......... recuerden que es gratis, nada cuesta opinar, compartir o agradecer :)



También te podría Interesar.


¿Hay algo que quieras anexar o comentar sobre esta entrada?  no dudes en hacerlo.....y si te gustó...... te invito a compartir
 y Suscribirte ingresando al botón "Participar en este sitio" para darte cuenta de mas entradas como esta ;)

76 comentarios:

  1. Hola, muy buena información, tengo una duda. Sabes como asignar una tecla o combinación de estas a un elemento del menú como en la primera imagen de esta publicación?

    ResponderEliminar
    Respuestas
    1. Hola Si señor......... se me pasó ponerla pero es muy simple, agrega esta linea al codigo y listo, le asigno el Ctrl+N al item Nuevo. si te sirve me avisas ;)

      menuItemNuevo.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));

      Eliminar
    2. The effectiveness of IEEE Project Domains depends very much on the situation in which they are applied. In order to further improve IEEE Final Year Project Domains practices we need to explicitly describe and utilise our knowledge about software domains of software engineering Final Year Project Domains for CSE technologies. This paper suggests a modelling formalism for supporting systematic reuse of software engineering technologies during planning of software projects and improvement programmes in Final Year Projects for CSE.

      Software management seeks for decision support to identify technologies like JavaScript that meet best the goals and characteristics of a software project or improvement programme. JavaScript Training in Chennai Accessible experiences and repositories that effectively guide that technology selection are still lacking.

      Aim of technology domain analysis is to describe the class of context situations (e.g., kinds of JavaScript software projects) in which a software engineering technology JavaScript Training in Chennai can be applied successfully

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Eliminar
  2. lo tome para guiarme , gracias!

    ResponderEliminar
  3. Felicidades por tu trabajo

    ResponderEliminar
  4. como se puede poner el codigo para guardar

    ResponderEliminar
    Respuestas
    1. Hola, no te entiendo, necesitas el codigo fuente, guardar archivos, datos de un formulario etc, cualquier cosa me comentas

      Eliminar
  5. se refiere ah que es si queremos guardar un archivo , como seria el codigo de ahi.

    ResponderEliminar
    Respuestas
    1. Hola, podrian utilizar el JFileChooser en alguno de los eventos del Menù, sea en un item o donde quieran......esta entrada les puede servir ;)
      http://codejavu.blogspot.com/2013/11/ejemplo-jfilechooser.html

      Eliminar
  6. hola buen dia cristian muy buen trabajo vengo mirando esta pagina hace mese me parece estupendo su trabajo me encantaría si me pudiera dar una idea de como hacer que un formulario se pueda abrir en diferentes pestañas le agradecería mucho tengo algo semejante pero no queda como quiero espero me puedas ayudar espero tenga buen dia

    ResponderEliminar
  7. muy buena información, muchas gracias por compartir tu buenos conocimientos,,....

    ResponderEliminar
  8. Its really an Excellent post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog. Thanks for sharing.
    Azure Training Classes

    ResponderEliminar
  9. It is a great post. Keep sharing such kind of useful information.

    karnatakapucresult
    Education

    ResponderEliminar
  10. QuickBooks Payroll has emerged among the best accounting software which has had changed the meaning of payroll. QuickBooks Payroll Support Phone Number will be the team that provide you Quickbooks Payroll Support.

    ResponderEliminar
  11. QuickBooks Enterprise has almost eliminated the typical accounting process. Along with a wide range of tools and QuickBooks Enterprise Support Phone Number it provides a wide range of industry verticals with specialized reporting formats and tools

    ResponderEliminar
  12. And along side support for QuickBooks Customer Support Number, it is less difficult to handle most of the tools of QuickBooks in a hassle-free manner. Below is a summary of several QuickBooks errors that one may meet with if you are using it. Have a glimpse at it quickly.

    ResponderEliminar
  13. Creating a set-up checklist for payment both in desktop & online versions is a vital task that needs to be shown to every QuickBooks user. Hope, you liked your internet site. If any method or technology you can not understand, if that's the case your better option is which will make call us at our Quickbooks Payroll Support Phone Number.

    ResponderEliminar
  14. QuickBooks users are often found in situations where they have to face many of the performance and some other errors due to various causes in their computer system. If you need any help for QuickBooks errors from customer service to get the solution to these errors and problems, you can easily contact with Intuit QuickBooks Support Number and get instant help with the guidance of our technical experts.

    ResponderEliminar
  15. So, there is absolutely no point in wasting your time and effort, getting worried for the problem you are facing an such like. Just call and you'll get instant respite from the difficulty due to various QuickBooks Customer Support Number.

    ResponderEliminar
  16. QuickBooks Support Number have trained staff to soft your issue. Sometimes errors may possibly also happen as a result of some small mistakes. Those are decimals, comma, backspace, etc. Are you proceed through to handle this? Until you, we've been here that can help you.

    ResponderEliminar
  17. all at one place. Are QuickBooks Enterprise Tech Support errors troubling you? Are you completely fed up with freezing of QuickBooks? If yes, afterward you have browsed off to the right place.

    ResponderEliminar
  18. Every user can get 24/7 support services with our online technical experts using Quickbooks Support. When you’re stuck in a situation where you can’t find a way to get rid of an issue, all you need is to dial QuickBooks customer support phone number. Be patient; they will inevitably and instantly solve your queries.

    ResponderEliminar
  19. immediately at our QuickBook Support phone Number QuickBooks technical help is present at our dial this and gets your solution from our technical experts.

    ResponderEliminar
  20. At QuickBooks Technical Support Number, you will find solution every single issue that bothers your projects and creates hindrance in running your company smoothly.

    ResponderEliminar
  21. QuickBooks Enterprise Tech Support Phone Number enables you to manage your company operations by getting you the latest versions of QuickBooks Enterprise like QuickBooks Enterprise 2019. Just dial QuickBooks Enterprise number to know the advantages and cons of accounting software with the help of our QuickBooks tech support members.

    ResponderEliminar
  22. QuickBooks Technical Support Number understand your growing business need and that is the reason we provide only the best. We make sure to give worth of each penny by providing the customer friendly technical support services.

    ResponderEliminar
  23. You are always able to relate with us at our QuickBooks Support Phone Number to extract the very best support services from our highly dedicated and supportive QuickBooks Support executives at any point of the time as most of us is oftentimes prepared to work with you. A lot of us is responsible and makes sure to deliver hundred percent assistance by working 24*7 to meet your requirements. Go ahead and mail us at our quickbooks support email id whenever you are in need. You might reach us via call at our toll-free number.

    ResponderEliminar
  24. To experience an amount of expertise in payroll management through QuickBooks, all of us tries to boost your understanding of the payroll updates occurring in QuickBooks Support, desktop, pro, premier 2019 versions. Intuit Payroll Online exports all the transactions to QuickBooks Desktop App along with QuickBooks Payroll Support Contact Number as standalone software.

    ResponderEliminar
  25. QuickBooks Support Number For Business All the above has a specific use. People working with accounts, transaction, banking transaction need our service. Some people are employing excel sheets for a few calculations.

    ResponderEliminar
  26. Well! If you’re not in a position to customize employee payroll in QuickBooks Payroll Support Number while making the list optimally, in QB and QB desktop, then browse the description ahead.

    ResponderEliminar
  27. QuickBooks 6000 series, QuickBooks PS series square measure a number of the foremost common and then the most dangerous errors that our Users need to face. therein case, they ought to forthwith dial the fee QuickBooks Support Phone Number.

    ResponderEliminar
  28. Inuit has surely made inventory management an invaluable feature associated with the QuickBooks. Because the user can quickly cope with vendors and wholesalers and payment (pending or advance) linked to vendors and wholesalers. Our QuickBooks Customer Support Number team will surely there for you to guide and help you in inventory management.

    ResponderEliminar
  29. Professional Services: there are many other services where accounting could be the core part of the complete business functioning. QuickBooks Enterprise Tech Support Number has something for that as well.

    ResponderEliminar
  30. Everbody knows you will find always two sides to a coin and QuickBooks Support is not any different. This software also throws some errors over time. Sometimes it becomes rather difficult to know this might be with this error code or message.

    ResponderEliminar
  31. By usingQuickBooks Payroll Tech Support number, you're able to create employee payment on time. However in any case, you might be facing some problem when making use of QuickBooks payroll such as for instance issue during installation, data integration error, direct deposit issue, file taxes, and paychecks errors, installation or up-gradation or simply just about some other than you don’t panic, we provide quality QuickBooks Payroll help service. Here are some features handle by our QB online payroll service.

    ResponderEliminar
  32. Entering your details each time you make any transaction takes your time and in addition opens windows of committing mistake specially when you're in hurry and so this amazing property of QuickBooks Support Phone Number helps to make your work easy.

    ResponderEliminar
  33. Amended income tracker, pinned notes, better registration process and understandings on homepage are the large choice of general alterations for several versions of QuickBooks 2015. It can benefit for QuickBooks Enterprise Contact Phone Number to acquire technical help & support for QuickBooks.

    ResponderEliminar
  34. QuickBook Tech Support research team is always prepared beforehand because of the most suitable solutions which can be of good help and less time intensive. Their pre-preparedness helps them extend their hundred percent support to all or any the entrepreneurs as well as individual users of QuickBooks.

    ResponderEliminar
  35. Sometimes you don't forecast the precise budget. We've got experienced people to offer the figure. We're going to also provide you with the figure of your respective budget which you can be in the near future from now. This is only possible with QuickBooks Tech Support Number

    ResponderEliminar
  36. The application offers convenient features including Advanced inventory management, Advanced pricing points, Advanced reporting and an enhanced QuickBooks Enterprise Tech Support Phone Number mechanism to help you keep track of employee salaries with ease.

    ResponderEliminar
  37. QuickBooks is obviously a delightful and well-known name because of its 100% accuracy, certainty, and reliability. So that as we all know that QuickBooks Support Phone Number has its own great features and QuickBooks scan manager is just one of the amazing top features of QuickBooks to simply maintain your all documents.

    ResponderEliminar
  38. QuickBooks Customer Technical Support Phone Number Services provide solutions to your entire QuickBooks problem as well as assists in identifying the errors with QuickBooks data files and diagnose them thoroughly before resolving these issues.

    ResponderEliminar
  39. For all associated with the small or mid-sized businesses organizations, it will always be been the most challenging task to easily manage the QuickBooks Support Number business accounts in an effective and genuine way simply by finding the appropriate solutions.

    ResponderEliminar
  40. Why don't we show you in partitioning most of the QuickBooks errors by dialing the Intuit QuickBooks Support for any technical problem that you’re facing whereas victimization the code. Your final decision is used in a team of QuickBooks specialists WHO square measure extremely skillful and also have many years of expertise. they’ll resolve the errors fleetly and locate you back in business in no time.

    ResponderEliminar
  41. With QuickBooks Payroll Support Number service you can easily fill all the Federal forms simply by few clicks and send them to your appropriate federal agencies. QuickBooks payroll assisted, intuit files and pays the taxes to your requirements.

    ResponderEliminar
  42. The probabilities are that this dilemma arises since the print head has been clogged by dried ink, or this hasn’t been cleaned up for many years. Hence, to solve HP printer print head problems, the consumer can go directly to the HP Printer Support Number option stating Control Panel – Device service -Clean Print head.

    ResponderEliminar
  43. HP inkjet printers are one of the most reliable and well known printers in the world that helps the HP Inkjet Printer Support Number users to print good quality documents. Hp inkjet printers are user compatible , easy to use.

    ResponderEliminar
  44. The principal intent behind QuickBooks Phone Number is to provide the technical help 24*7 so as in order to avoid wasting your productivity hours. This is completely a toll-free QuickBooks client Service variety that you won’t pay any call charges. Of course, QuickBooks is one among the list of awesome package in the company world. The accounting part of the many companies varies according to this package. You'll find so many fields it covers like creating invoices, managing taxes, managing payroll etc. However exceptions are typical over, sometimes it generates the down sides and user wants QuickBooks client Service help.

    ResponderEliminar
  45. Are you currently utilising the software the first time? You will get some technical glitch. You will have errors also. Where do you really turn? Take assistance from us straight away. We will provide full support to you. You are able to cope with a lot of the errors. We must just coach you on something. Thoughts is broken trained, you will get everything fine. Where can you turn when you have to deal with the company’s transaction? It must be flawless. Do you think you're confident about this? If not, this might be basically the right time to get the QuickBooks Support Number. We have trained staff to soft your issue. Sometimes errors may also happen as a consequence of some small mistakes. Those are decimals, comma, backspace, etc. Are you proceed through to cope with this? Unless you, we have been here that can help you.

    ResponderEliminar
  46. QuickBooks Payroll Support Phone Number helps you to definitely resolve your entire technical and functional issues while looking after this well known extensive, premium and end-to-end business accounting and payroll management software. Our experts team at QuickBooks payroll support number is going to make you realize its advanced functions and assists anyone to lift up your business growth.

    ResponderEliminar
  47. Our instantly QuickBooks Support team is perfect in taking down every QuickBooks error. We can assure you this with an assurance. Call our QuickBooks Support telephone number. Our QuickBooks Tech Support Phone Number team will attend you.

    ResponderEliminar
  48. We have customer care executives which are exceptionally supportive and pay complete awareness of the demand of technical assistance made by QuickBooks Technical Support Phone Number users.

    ResponderEliminar
  49. In this web site, we are going to enable you to experience to make and place up the checklist for employee payment. To get more enhanced results and optimized benefits, you are able to take the assistance of experts making a call at QuickBooks Payroll Support Phone Number.

    ResponderEliminar
  50. Any QuickBooks user faces any sort of identified errors in their daily accounting routine; these errors can differ in one another to a sizable degree, so our dedicated QuickBooks Support Number are very well designed with their tools and expertise to produce most effective resolutions very quickly to the customers.

    ResponderEliminar
  51. QuickBooks Payroll Tech Support Number is assisted by our customer support specialists who answr fully your call instantly and resolve all of your issues at that moment. It is a backing portal that authenticates the users of QuickBooks to perform its services in a user-friendly manner.

    ResponderEliminar
  52. The QuickBooks Support Number stays top-notch because the technicians who will be going to cope with your queries are trained to what you need and versatile with regards to taking quick decisions that can instantly solve the reported error.

    ResponderEliminar
  53. To get support from experts, use our QuickBooks Helpline Number +1-855-236-7529. QuickBooks is a business solution that is capable of performing functions like payroll management, accounting, inventory management, and many more. With all these functions, it comes with a bucket of errors and bugs. QuickBooks is an easy to use interface that helps the small and medium business to perform their accounting task. Or contact at QuickBooks Error 12007
    Read more: https://www.techiesupportnumber.com/quickbooks-error-12007/

    ResponderEliminar
    Respuestas
    1. Such an amazing stuff! Keep going like this and I hope you will reach your goal. Besides, if you want an accounting software that can handle all the task related to accounting with ease then go for QuickBooks. Moreover, there is a great support available in the form QuickBooks Helpline Number 1-855-907-0605. Read More: https://dentalphonenumber.com/quickbooks-helpline-number/

      Eliminar

  54. QuickBooks Error 6000 832? What is it & How it occurs?! Call Quickbooks tech support number 1-888-238-7409 for resolution. Visit us:- https://www.enetquickbookenterprise.com/quickbooks-error-6000-832/

    ResponderEliminar
  55. Hey, greetings and thanks a lot for sharing this excellent blog. I admire the creativity and efforts involved in bringing it out. Are you fed up of erroneous occurrences like the QuickBooks Error 3371, Status Code -11118? You can resolve this error through 24*7 assistance at QuickBooks Support Phone Number 1-833-441-8848.

    ResponderEliminar
  56. Hi! Excellent post. I couldn’t leave your website without informing you that I liked your blog. I have been using QuickBooks software for the last four months. It is a comprehensive accounting software, and I highly recommend others to give it a shot. To get support for QuickBooks errors, reach our talented experts via QuickBooks Customer Support Phone Number +1-855-907-0605.

    ResponderEliminar
  57. QuickBooks users might face technical issues but they can resolve them shortly, with the help of brilliant executives. They can report all queries and problems to customer care executives. The squad would provide meaningful solutions to its users at QuickBooks Support Phone Number +1-844-232-O2O2.read more:-https://tinyurl.com/y42ywocq
    & visi us:-https://jamessmithsu.wixsite.com/quickbookssupport

    ResponderEliminar
  58. Extremely common to handle banking errors like QuickBooks Error code 9999. When such an error takes place, the machine tends to freeze for a couple of seconds on repeat. This example can obviously affect business awfully. If you would like to learn how to Troubleshoot Quickbooks Error 9999 yourself, you can continue reading this blog.

    ResponderEliminar
  59. If you get any technical glitch in the software, get reliable assistance via QuickBooks Customer Service Phone Number 1-833-780-0086. It is quite common to observe technical issues in the software, resolve it by giving a call on the QuickBooks Service. For More Visit: https://g.page/quickbookssupporttexas

    ResponderEliminar
  60. Este comentario ha sido eliminado por el autor.

    ResponderEliminar

Eres libre de realizar cualquier comentario, desde que pueda ayudar con gusto lo atenderé, y si es un critica, bienvenida sea!!!