Tag netbeans

[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(“”))); label[i].setPreferredSize(new Dimension(50,…

[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…

[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…

[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] 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…