Hi All, If I read in from a file and populate an array with its data(all strings), how can I control the way it prints(to the console for example).Right now it just prints a huge long line in the console of all its contents. I figure I will have to implement for loops to get it to print line by line from the text file. My main goal is eventual learning how to print it to an excel file but I am taking baby steps there to learn how to manipulate an array. Also, would an arrayList be a better …

Member Avatar
Member Avatar
+0 forum 13

Hi all, I have a main GUI class as seen here: [CODE] import java.awt.*; import javax.swing.*; import javax.swing.border.*; /* * Class is to communicate with various other classes in the program to * create a roster for user based on their selection on GUI. */ public class MainGUI extends JFrame { private static final long serialVersionUID = 1L; //declares window width and height for program final int WINDOW_WIDTH = 1000; final int WINDOW_HEIGHT= 1000; private PlatoonPanel pp; private SquadPanel sp; private ManualPanel mp; private ActionButtons ab; private static Container pane; public MainGUI() { //sets title setTitle("Roster Generator Version 0.0.1"); //sets …

Member Avatar
Member Avatar
+0 forum 10

Hi all, If I write a java program inside of eclipse, how can I run that program outside of it, rather than just hitting the run button in eclipse. So, I can give others the program to run on their computers. Thanks!

Member Avatar
Member Avatar
+0 forum 7

Hi All, I am currently trying to figure out to finish this project. Below is my code that I have so far. There are some blank methods that I am not sure where to even begin on how to complete them. I have a description of what the methods should do above them, so please help guide me on the blank methods so I can figure them out. Part of what is confusing to me is how to get the data that is read from the file and use it in the conversions since some of the data is inputted …

Member Avatar
Member Avatar
+0 forum 126

Hi All, The GUI works as intended to. But I was wondering if some of you java gurus could look over my code and maybe give me some tips on how I could have written this code better. Thanks! [B]GUI CLASS: [/B] [CODE]import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.TitledBorder; /* * ColorSectionGUI Class, creates an program that allows user to select a direction or multiple selections * from 4 checkboxes and allows them to choose one of four colors to change the direction that they selected * colors. */ public class ColorSelectionGUI extends JFrame { …

Member Avatar
Member Avatar
+0 forum 7

Hi all, I am having trouble with class communication to reset some textfields through event handling. Any help would be appreciated. Here is a portion of my code. [B]The class that contains the textfields that I wish to use a reset button for:[/B] [CODE]import java.awt.*; import javax.swing.*; import javax.swing.border.*; public class FinancingInformation { JTextField basePriceText; JTextField downPaymentText; JTextField salesTaxText; private JLabel basePriceLabel, downPaymentLabel, salesTaxLabel; private TitledBorder financingInformationBorder; private JPanel financingInformationPanel; public FinancingInformation(){ financingInformationPanel = new JPanel(); basePriceLabel = new JLabel("Base Price: $"); downPaymentLabel = new JLabel("Down Payment: $"); salesTaxLabel = new JLabel("Sales Tax: $"); basePriceText = new JTextField("0.0"); downPaymentText = …

Member Avatar
Member Avatar
+0 forum 1

Hi All, I was having trouble with getting my program to display all the necessary conversions. Here is a snippet of the code to help explain what I want to do: [CODE] private class CalcListener implements ActionListener{ public void actionPerformed(ActionEvent e){ String centInput, inchInput, meterInput, yardInput; double cent, inch, meter, yard; yardInput = yardsText.getText(); inch = Double.parseDouble(yardInput) * 36.00; cent = Double.parseDouble(yardInput)* 91.44; meter = Double.parseDouble(yardInput) * 0.9144; inchText.setText(String.valueOf(inch)); centText.setText(String.valueOf(cent)); meterText.setText(String.valueOf(meter)); [/CODE] This will allow me to put an input into the "Yards" Textfield so that when I click calculate, the inch, cent, and meter Textfields will display their proper …

Member Avatar
Member Avatar
+0 forum 36

The End.