[Solved] How do I get rid of the gaps between the tiles?

You need to add the JButton to mainPanel instead of panel. Some duplicated lines and not necessary settings removed for (int i = 0; i < 64; i++) { label[i] = new JButton(); label[i].setBorderPainted(false); mainPanel.add(label[i]); label[i].setIcon(new ImageIcon(getClass() .getResource(“/org/me/images/O.png”))); label[i].setPreferredSize(new Dimension(50, 50)); label[i].setToolTipText(“label” + i); } 0 solved How do I get rid of the gaps … Read more

[Solved] Netbeans desktop application of teacher attendance [closed]

You may want to add a LayoutManager to your window. NetBeans has support for it. Right-click inside your window in NetBeans, hover “Set Layout” and select a proper LayoutManager. I always use GridBagLayout. Here is a tutorial: http://docs.oracle.com/javase/tutorial/uiswing/layout/gridbag.html Good Luck. 10 solved Netbeans desktop application of teacher attendance [closed]

[Solved] Parameter pass method two method in java

I guess you want to construct your query depending on the selected JCheckBoxes. The below code snippet works, if: You created a JCheckBox[] checkBoxes field that contains all the checkboxes with languages. The text of all those JCheckBox is exactly the String that should be placed inside the ‘. public void search() { // join … Read more

[Solved] Java How to display string like this [closed]

try this: public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String text = sc.nextLine(); System.out.println(text); for(int j=0;j<text.length();j++) { char firstLetter = text.charAt(0); //get the first letter text = text.substring(1); //remove the first letter from the input string text = text + firstLetter; System.out.println(text); } } } 4 solved … Read more

[Solved] Netbeans would not find compatible jdk while installation

From NetBeans Installation Instructions The default location in Windows is C:\Program Files\Java\jdk1.7.0_10 or similar. If your JDK is at C:\Java you just have to: re-install the JDK under the default Netbeans location, or specify your custom location during the installation wizard 2 solved Netbeans would not find compatible jdk while installation

[Solved] java, “do this if passes then do this” [closed]

you’re not looking for an if statement are you? if(error.Colour() == /*insert value to check here*/) { calculate.setKey(key); calculate.setQuantity(QuantityInt); double cost = calculate.calculateBill(); information.append(“\n\nTotal cost: £” + pounds.format(cost)); } 5 solved java, “do this if passes then do this” [closed]

[Solved] How do I dynamically resize a text component in Java Netbeans, when the text has filled the component, instead of it having scroll bars?

How do I dynamically resize a text component in Java Netbeans, when the text has filled the component, instead of it having scroll bars? solved How do I dynamically resize a text component in Java Netbeans, when the text has filled the component, instead of it having scroll bars?

[Solved] compare HashMap and ArrayList java

You can compare like below Code: List<String> global = new ArrayList<String>; Map<String, ArrayList<String>> newMap = new HashMap<String, ArrayList<String>>(); Map<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>(); for (String key:map.keySet()) { List<String> arrayList= map.get(key); for (String words:arrayList) { List<String> newList = new ArrayList<String>; for (String globallist:global) { if(words.equals(globallist)){ newList.add(words); } } newMap.put(key,newList); } } 1 solved compare … Read more