Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Keep PrintStream Redirect across multiple scenes

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to everybody. I have a problem and i could really use some help
I have a JavaFX application with multiple scenes.
In the application one scene plays the "master" role and the others are loaded according to actions
The issue i have is that i need to redirect all the PrintStream activity to a specific TextArea on the "master" scene,
and by "all" i am meaning every PrintStream activity on every scene should be redirected to this specific TextArea
The code i am using on the "master" is :


I am using the Singleton pattern for the rest of the scenes is:


The issue is that i don't like this implementation so ...is there a better solution
 
John Tsioumpris
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

John Damien Smith wrote:Question is also available on StackOverflow:

http://stackoverflow.com/questions/28728458/keep-printstream-redirect-across-multiple-scenes


Is it against any rule ?
 
John Damien Smith
Rancher
Posts: 387
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More of a guideline than a rule:

https://coderanch.com/how-to/java/BeForthrightWhenCrossPostingToOtherSites
 
John Tsioumpris
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

John Damien Smith wrote:More of a guideline than a rule:

https://coderanch.com/how-to/java/BeForthrightWhenCrossPostingToOtherSites


Thanks for letting me know....i am afraid i was under a lot of pressure to get this done....but i think i have found a solution...
So if you find this post offending in anyway please delete it...sorry for the cross posting but i have a hard time to get some answers and time is ticking
 
John Damien Smith
Rancher
Posts: 387
30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't mind cross-posting as long as links are posted, so that anybody who finds the post can find related information and work on the issue.

If you have independently found a solution, you should post it on one of the sites you asked your question on, and link to your solution from other posts (probably post it on stack overflow as stack overflow doesn't allow link only answers).

My advice is to try to write perfect questions - as those question types are more likely to get answered.

I answer many questions on different forums and I have read your question numerous times and have not been able to understand exactly what it is asking, nor how to solve it.
I have seen others attempt to answer your question and fail to answer satisfactorily.
If the question is clear, interesting, simple to understand and any issue lucidly explained and immediately reproducible at the time the question is first read, then you are far more likely to get better help sooner.
 
John Tsioumpris
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

John Damien Smith wrote:I don't mind cross-posting as long as links are posted, so that anybody who finds the post can find related information and work on the issue.

If you have independently found a solution, you should post it on one of the sites you asked your question on, and link to your solution from other posts (probably post it on stack overflow as stack overflow doesn't allow link only answers).

My advice is to try to write perfect questions - as those question types are more likely to get answered.

I answer many questions on different forums and I have read your question numerous times and have not been able to understand exactly what it is asking, nor how to solve it.
I have seen others attempt to answer your question and fail to answer satisfactorily.
If the question is clear, interesting, simple to understand and any issue lucidly explained and immediately reproducible at the time the question is first read, then you are far more likely to get better help sooner.


Thanks for the advices
As for the solution....well is quite simple...i simple don't close the PrintStream...I set the redirection and forget about it...(it seems to work ?)
 
You can thank my dental hygienist for my untimely aliveness. So tiny:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic