Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8177299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:28:27+00:00 2026-06-06T23:28:27+00:00

I am using a Java Project that gives an user interface for doing some

  • 0

I am using a Java Project that gives an user interface for doing some user events. It is not being executed as Runnable thread in main() as in most Swing/Gui applications. Rather it has several class and form files in the source code and is run from command line using another Java program.
But when I am trying to read a certain file by clicking on some input button, the system fails to read the file. The system writes the custom error message into a file named log.txt saved within the project folder.
I have tried
1. Setting breakpoints (the application does not stop at breakpoint)
2. Doing console prints i.e. System.out.println (there is no print on console)

So both the ways of debugging has failed. I am using Eclipse 3.5.2 SDK (Galileo). How can I debug the user events on my applicattion?

The outline of the source class DataImportPanel in project DDMT is listed below. It is giving an exception in the method DataImportPanel.openHeteroFile(File).

DDMT.core.DataImportPanel 
... 
DDMT.core.DataImportPanel.heteroDistributionModel 
...  
DDMT.core.DataImportPanel.initComponents() 
DDMT.core.DataImportPanel.initComponents().new ActionListener() {...} 
...
DDMT.core.DataImportPanel.initComponents().new MouseAdapter() {...} 
DDMT.core.DataImportPanel.initComponents().new ActionListener() {...} 
DDMT.core.DataImportPanel.jButton2ActionPerformed(ActionEvent) 
... 
DDMT.core.DataImportPanel.jButton3ActionPerformed(ActionEvent) 
DDMT.core.DataImportPanel.openHeteroFile(File) 
DDMT.core.DataImportPanel.jButton8ActionPerformed(ActionEvent)  
DDMT.core.DataImportPanel.openFile(File) 
DDMT.core.DataImportPanel.jButton15ActionPerformed(ActionEvent) 
DDMT.core.DataImportPanel.jRadioButton1ActionPerformed(ActionEvent)  
DDMT.core.DataImportPanel.buttonGroup1  
...
DDMT.core.DataImportPanel.jButton8 
DDMT.core.DataImportPanel.jButton9 
DDMT.core.DataImportPanel.jLabel1 
... 
DDMT.core.DataImportPanel.jList1 
... 
DDMT.core.DataImportPanel.jPanel1 
... 
DDMT.core.DataImportPanel.jRadioButton1 
...
DDMT.core.DataImportPanel.jScrollPane1 
... 
DDMT.core.DataImportPanel.jTabbedPane1 
DDMT.core.DataImportPanel.DistributionTypes 
DDMT.core.DataImportPanel.DoubleCellRenderer

Here is the openHeteroFile which is throwing the Data Import exception

private void openHeteroFile(File f)
{
    File file = null;
    try{
        file = f;
        file.createNewFile();
        FileReader reader = new FileReader(file);
        BufferedReader bReader = new BufferedReader(reader);

        //The vector that holds the number of columns
        attributeNames = new ArrayList<String>();

        //Read in the number of pairs
        String line = bReader.readLine();

        //load the file
        heteroDistributionModel = new DefaultListModel();
        line = bReader.readLine();
        while( line != null )
        {
            //Set up the RegEx matches
            heteroDistM = heteroDistP.matcher(line);
            firstM = firstP.matcher(line);
            firstM.find();
            String output1 = firstM.group()+" (";
            for( int j = 0; j< nodeTypes[0].length; j++)
            {
                if( controlClass.nodes[Integer.parseInt(firstM.group())].getNodeType().equals( nodeTypes[1][j]) )
                {
                    output1 = output1+nodeTypes[0][j]+")";
                }
            }
            String output2 = new String();
            while( heteroDistM.find() )
            {
                attributeNames.add(heteroDistM.group(1));
                output2 = output2 + " "+heteroDistM.group(1);
            }
            heteroDistributionModel.addElement(new String[]{output1, output2});
            line = bReader.readLine();
        }

        for (String attr : attributeNames) 
            System.out.println(attr); //debug


        jList3.setModel(heteroDistributionModel);
        jList3.setCellRenderer(new DoubleCellRenderer());
        bReader.close();
        reader.close();
    }catch(IOException ex)
    {
        controlClass.showError("Data Import: Error: File "+file.getPath()+" is not a valid Heterogeneous data file!");
    }catch(Exception ex)
    {
        ex.printStackTrace(); //debug
        controlClass.showError("Data Import: Error: Unknown problem reading file "+file.getPath()+"!");
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:28:28+00:00Added an answer on June 6, 2026 at 11:28 pm

    There is a little green ladybug right next to the run button that starts the debugger.

    I would make sure the proper calls are being made. Also check your brackets, breaks, and returns to make sure the code is actually being read. Please post a SSCCE (Short, Self Contained, Correct Example) so we can view your code to help you out better.

    Edit (after OP added some code)

    I’m pretty sure your issue is where you file.createNewFile();

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java project that I build using an Ant script. I am
I have recently just created Java project using Eclipse that requires 2 JAR files
I have got a project that is using jni to connect java wrapper and
I have a Java application that is managed using Maven. The project involves the
I am using Netbeans IDE for a java project. In this project i need
I have a Java project connecting to an Ingres database and using the Spring
I have a Maven Java project, imported using m2eclipse . The target/ directory is
I have recently created a web project in Java using eclipse. I have a
My project is to implement minimum spanning tree using java. I aim to use
I am using maven to generate a website for a Java project, which uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.