java - Setting an icon image to top right and bottom left buttons -


How do I create a 4x4 grid of colorful, clickable areas using swing? OK, so the buttons I need are the I have my updated code. Now I am trying to get text field or jalebell to show the bottom left. But I can not get it to work. I thought that could make another panel, but apparently not.

  import java.awt. *; Import java.util.ArrayList; Import javax.swing. *; Public Class Heist {Array List & Lieutenant; Jebton & gt; Button = new arreelist & lt; Jebton & gt; (); Public Heist () {Jeffrey Frame = New Geoffram ("Hedge!"); Frame.setLayout (new border layout ()); JPNext Top = New JPN (); Top.setLayout (New BoxLayout (top, BoxLayout.LINE_AXIS)); Top.add (new JTextField ("move:")); Jpgnl center = new zpn (); Center.setLayout (new grid layout (4,4)); For (int i = 0; i <16; i ++) {center.add (new payton ()); Buttons.add (new pocket ()); } Zeppel Down = new zpn (); Zeppel Down R = New Zeppel (); Bottom. Sealout (new grid layout (1,2)); Below R.Scallout (new grid layout (1,2)); R.add below (New Zebutton ("EMP"); R.add below (new pocket ("reset"); Bottom.add (new JTextField ("Enter / Exit")); Container pane = frame.getContentPane (); Pane.add (top, border layout. North); Pane.add (center, border layout .ca); Pane.add (bottom, border layout. South); pane.add (R below, border layout. SOTH); Frame.pack (); Frame.setSize (400400); Frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Frame.setVisible (true); } Public static zero principal (string [] args) {Heist gui = new Heist (); }   

}

OK, okay So far I've made a guitar, but I'm not sure how to add areas. I have tried to add several buttons but this is just a button

to JFrame shows border layout , which allow only one single component to capture any of the five available positions



Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -