I have the following java class which has many private variables and methods:
package gui;
import java.awt.Color;
import java.io.File;
import java.util.*;
import java.util.stream.Stream;
import javax.swing.*;
import messages.Message;
import net.miginfocom.swing.MigLayout;
import utils.*;
public class FileCopyManager extends JFrame {
public static String appName = "File Copy Manager v1.6.4.0";
private PreferencesManager pManager = new PreferencesManager(this);
private JCheckBoxMenuItem allowDuplicatesOption = new JCheckBoxMenuItem("Allow dupliactes in list");
private Controller controller = new Controller();
private StatusFrame status = new StatusFrame();
private FileHandler fHandler = new FileHandler(status);
private Message msg = new Message();
private JMenuBar menuBar = new JMenuBar();
private JMenu fileMenu = new JMenu("File"),
editMenu = new JMenu("Edit");
private JMenuItem saveList = new JMenuItem("Save queue"),
exit = new JMenuItem("Exit"),
loadList = new JMenuItem("Load queue"),
openAppDirectory = new JMenuItem("Open app folder"),
showPreferences = new JMenuItem("Preferences"),
exportPreferences = new JMenuItem("Export Preferences"),
deleteApp = new JMenuItem("Delete app settings"),
restartApp = new JMenuItem("Restart Application");
private File selectedFile = null;
private String destinationPath = null;
private ArrayList<File> files = new ArrayList<>();
private JPanel panel = new JPanel();
private JFileChooser chooser = new JFileChooser();
private JButton addFiles, selectDestination, copyFile, copyFiles,
deleteFile, deleteAll, openDestinationFolder,stopCopy;
private JComboBox<String> fileNames;
private DefaultComboBoxModel<String> model;
private int selectedFileIndex = -1;
private JTextField dragPanel = new JTextField(20);
private JLabel dragLabel;
private File listFile = new File("app"+PreferencesManager.sep+"userList.dat");
private boolean allowDuplicates = false;
private Thread[] copyThreads = new Thread[2];
private boolean isNull(Object...t){
/*
* Check if any of the arguments is null
*/
}
private void allowCopy(){
/*
* Enables certain buttons based on certain criteria
*/
}
private void allowDelete(){
/*
* Enables certain buttons based on certain criteria
*/
}
private void allowEdits(){
/*
* Enables certain buttons based on certain criteria
*/
}
private void createList(){
//Create a list with some random names
}
private void initDragAreas(){
/*
* Create some drag and drop ares in the GUI
*/
}
public void updateList(){
// Update a lst in the CUI with some names
}
public void showFiles() {
//Show some file names in the GUI
}
public void restart(){
//Code that restarts the GUI
}
@SuppressWarnings("deprecation")
private void initUIElements() {
/***
* Create some UI elements
*/
initDragAreas();
}
public JLabel[] getLabels() {
// return some labels
}
public JButton[] getButtons() {
// return some buttons
}
public void preload() {
/*
* See if we need to change the main UI(change colors or font size)
* and if we need do it first and then show the app
*/
}
public FileCopyManager) {
initUIElements();
preload();
}
}
This application is a small project I made for fun during summer. I was wondering: Is it a bad thing to use too many private members and methods?
Would it be bad for a production code?