Question: This is code ////// //////////////////////////// Can you make this code to GUI version plz and it would be like this //////////////////////////////////////////////// import java.io.BufferedReader; import java.io.File;

This is code ////// //////////////////////////// Can you make this code to GUI version plz

and it would be like this This is code ////// //////////////////////////// Can you make this code to GUI

////////////////////////////////////////////////

import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.HashSet; import java.util.Set;

import javax.swing.JFileChooser;

public class HexagonMain { static Hexagon[] places = new Hexagon[7]; static Set solution = new HashSet(); // Set to store solutions. Set will avoid duplicate solutions

public static void main(String[] args) { Hexagon[] hexagons = new Hexagon[7]; JFileChooser jFileChooser = new JFileChooser(); jFileChooser.showOpenDialog(null); //prompts user to select file File file = jFileChooser.getSelectedFile(); if (file != null) { try { FileReader fr = new FileReader(file); BufferedReader br = new BufferedReader(fr); String input = null; int index = 0; while ((input = br.readLine()) != null && index

}

//method to arrange hexagons, inputs are hexagons and first position to place the hexagon public static void arrange(Hexagon[] hexagons, int start) { if (start

//Method to check if any every placement is valid public static boolean checkValid() {

for (int i = 0; i

}

File: Hexagon.java

public class Hexagon { char[] section; int position = -1; public Hexagon(String colorString){ //constructor section = colorString.toCharArray(); } //Method to rotate hexagon public void rotate(){ char temp = section[0]; for(int i=1;i section[i-1] = section[i]; } section[section.length -1] = temp; }

@Override public String toString() { return "Position " + (position + 1) + ": " + new String(section); }

}

//////////////////////////////////////////////////////////////////////////////////////////////////

3 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!