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 933703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:52:40+00:00 2026-05-15T20:52:40+00:00

This is driving me nuts. I have a working text based application. It has

  • 0

This is driving me nuts. I have a working text based application. It has many many variables which now need a GUI. I’m starting with the basics. Whenever some data is sent to my log, I want it to display in my textbox.

Here is a unified entry point for data to pass where it can be manipulated.

public class Log {

    private static void consoleOut(String data) {
    System.out.println(data);
    OBD2nerConsole.update(data);
    }
      public static void level0(String data) {
    if (Status.ConsoleLevel >= 0) {
    consoleOut(data);

    }

This is my form and it has a text box and a few buttons.

public class OBD2nerConsole extends java.awt.Frame {

    public static void update(String data) {
        textField1.setText(textField1.getText() + data);
    }   

}

The prolem I am having is that I am working with a static and non-static I guess.. There is nothing displayed in the text box. I kept playing around and removed all of the errors but it is not working. I don’t really know what to do. It seems that this is the best configuration, because there are no errors, but the text box is not doing anything.

I should probly add that this is my first form EVER!

  • 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-05-15T20:52:41+00:00Added an answer on May 15, 2026 at 8:52 pm

    If you give Log a static reference to an instance of OBD2nerConsole and remove static from update(String) you should be able to update the textField1.

    Listing of modified Log.java:

    public class Log {
        private static Updatable console = Updatables.getUpdatable();
    
        private static void consoleOut(String data) {
            System.out.println(data);
            console.update(data);
        }
    
        public static void level0(String data) {
            if (Status.ConsoleLevel >= 0) {
                consoleOut(data);
            }
        }
    }
    

    Listing of Updatable.java:

    public interface Updatable {
        void update(String);
    }
    

    Listing of modified snippet of ODB2nerConsole.java:

    public class OBD2nerConsole extends java.awt.Frame implements Updatable {
        @Override
        public void update(String data) {
            textField1.setText(textField1.getText() + data);
        }
    }
    

    Listing of Updatables.java:

    public class Updatables {
        public Updatable getUpdatable() {
            return new ODB2nerConsole();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not working and it is driving me nuts. I have in the
Okay, this sounds stupid but this is driving me nuts. I have been working
This has been driving me nuts for the last 2 days. I have 3
This is really driving me nuts, I have a datagridview bound to a bindingsource,
This is literally driving me nuts. I have 2 entities that use NSStrings as
This one's got me stumped and it's driving me nuts. I have a SiteFinity
This is driving me nuts. Here is some HTML and CSS that I have
So this is driving me nuts. I need to pull my table rows from
I realy need your help as this is driving me nuts. On my website
This is driving me nuts! I have a test instance of Wordpress installed on

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.