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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:25:03+00:00 2026-05-24T00:25:03+00:00

i receive float data from the network every 400 ms that i put in

  • 0

i receive float data from the network every 400 ms that i put in 4 arrays of float. I store those arrays in another array, so i have :

float[][] datas = {data1, data2, data3, data4};
FloatData floatData = new FloatData(datas);
model.addFloatData(floatData);

My model has a list of FloatData object and the FloatData object has the method :

float[] getFloatData(int index);

that returns the array of float that i want. This array is used to paint on a JPanel.
So in the painComponent i do the following :

for(FloatData floatData : listOfFloatData) {
floatData.draw(g, index);
}

My question is what kind of list can i use for the listOfFloatData as it will be updated every 400 ms and read in the paintComponent method ?
Also, i would like to know a convenient way to pass the listOfFloatData from the model to my view ? I was thinking about using a singleton object holding the listOfFloatData as this list will be used in several components ?
Thank you.

  • 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-24T00:25:04+00:00Added an answer on May 24, 2026 at 12:25 am

    Decouple the model from the view by storing your data in a subclass of AbstractTableModel. The flyweight pattern used by JTable is much more efficient at rendering, and you can modify your model as profiling warrants.

    Addendum: If you collect data on another thread, using e.g. SwingWorker, you can publish() the data with very low latency, while your process() implementation updates the model on the Event Dispatch Thread. There’s an example here.

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

Sidebar

Related Questions

When I receive data from the microphone via core audio, sometimes the buffers have
I have data coming over a socket that looks like this: (h)(int,char,float,int,char)(/h)(d)(2,a,1.32,45,d)(3,d,3.45,32,a)(/d) The datatype
I have a function that receives float** as an argument, and I tried to
I am using Flot to chart some data that I pull back from the
I have 41 computers that used MPI on the same local area network. MPI
We receive lots of data as flat files: delimitted or just fixed length records.
I receive TypeError: Can't convert 'float' object to str implicitly while using Gambler.pot +=
I receive some arguments into a stored procedure. These arguments are NVARCHAR's. I have
I receive a list of image URLs and currently I have several hidden img
I receive a string from a database query, then I remove all HTML tags,

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.