ui-thread

Guice creates Swing components outside of UI thread problem?

霸气de小男生 提交于 2019-11-30 22:20:27
I'm working on Java Swing application with Google Guice as an IOC container. Things are working pretty well. There are some UI problems. When a standard L&F is replaced with Pushing pixels Substance L&F application is not running due to Guice's Swing components creation outside of UI thread. Is there a way to tell Guice to create Swing components in the UI thread? Maybe I should create custom providers which will return Swing components after SwingUtilities.invokeAndWait(Runnable) creates them. I don't like the idea of running the whole application in UI thread, but maybe it's just a perfect

Android Service and UI Thread

独自空忆成欢 提交于 2019-11-30 14:52:54
问题 I have a Service running in my app.. This Service has an object for sending message to the server and a function to get that object and use it. The object is initialized from the Service and yet when the UI gets this objects and use it - it looks like it uses it on the UI Thread.. Is this correct ? Is there a way i can make my object always run from the Service Thread ? public class ServerMessagesManager extends Service { private ServerMessagesReceiver serverMessageReceiver; @Override public

Android Service and UI Thread

﹥>﹥吖頭↗ 提交于 2019-11-30 12:51:36
I have a Service running in my app.. This Service has an object for sending message to the server and a function to get that object and use it. The object is initialized from the Service and yet when the UI gets this objects and use it - it looks like it uses it on the UI Thread.. Is this correct ? Is there a way i can make my object always run from the Service Thread ? public class ServerMessagesManager extends Service { private ServerMessagesReceiver serverMessageReceiver; @Override public void onCreate() { super.onCreate(); this.serverMessageReceiver = new ServerMessagesReceiver(app); }

How do I test Prism event aggregator subscriptions, on the UIThread?

纵然是瞬间 提交于 2019-11-30 08:31:44
I have a class, that subscribes to an event via PRISMs event aggregator. As it is somewhat hard to mock the event aggregator as noted here , I just instantiate a real one and pass it to the system under test. In my test I then publish the event via that aggregator and then check how my system under test reacts to it. Since the event will be raised by a FileSystemWatcher during production, I want to make use of the automatic dispatch by subscribing on the UIThread, so I can update my UI once the event is raised. The problem is, that during the test, the event never gets noticed in the system

Guice creates Swing components outside of UI thread problem?

ぐ巨炮叔叔 提交于 2019-11-30 05:27:14
问题 I'm working on Java Swing application with Google Guice as an IOC container. Things are working pretty well. There are some UI problems. When a standard L&F is replaced with Pushing pixels Substance L&F application is not running due to Guice's Swing components creation outside of UI thread. Is there a way to tell Guice to create Swing components in the UI thread? Maybe I should create custom providers which will return Swing components after SwingUtilities.invokeAndWait(Runnable) creates

Wait screen during rendering UIElement in WPF

不羁岁月 提交于 2019-11-29 17:02:36
I have a WPF application using PRISM. I have a login screen and on successfuly logging in a new view containing a TileListView with many items appears. This needs over 10 seconds to render because control has to calculate a lot etc. All this uses the UI thread by standard behaviour, because rendering in WPF is done in UI thread. Is it possible to display a WaitControl like a spinner or just a simple animation in seperate window or something like this? Now to animation stops at the time, the control is rendered in UI Thread. You could create a new window that launches in a separate thread.

Interacting with UI threads in Java/J2ME

落爺英雄遲暮 提交于 2019-11-29 07:39:19
I'm writing a J2ME application. One of the pieces is something that polls the contents of a directory periodically, and, if there are any new things, paints them on the screen. I've done this by having the UI form launch a polling thread with a pointer back to itself, and when the polling thread finds something it calls back to the form and calls a syncrhonized method to update it's display. This seems to work fine. The question I have is this. In C#/.NET I know it is not nice to have non-UI threads updating the UI, and the correct way to handle this is to delegate it up to the UI thread. E.g.

Why is a single threaded model used to update the UI as main thread?

余生颓废 提交于 2019-11-28 21:33:27
The Qt doc says, As mentioned, each program has one thread when it is started. This thread is called the "main thread" (also known as the "GUI thread" in Qt applications). The Qt GUI must run in this thread. The Android doc says, Like activities and the other components, services run in the main thread of the application process And iOS, It is strongly recommended not to update UI controls etc from a background thread (e.g. a timer, comms etc). This can be the cause of crashes which are sometimes very hard to identify. Instead use these to force code to be executed on the UI thread (which is

Wait screen during rendering UIElement in WPF

↘锁芯ラ 提交于 2019-11-28 10:38:27
问题 I have a WPF application using PRISM. I have a login screen and on successfuly logging in a new view containing a TileListView with many items appears. This needs over 10 seconds to render because control has to calculate a lot etc. All this uses the UI thread by standard behaviour, because rendering in WPF is done in UI thread. Is it possible to display a WaitControl like a spinner or just a simple animation in seperate window or something like this? Now to animation stops at the time, the

Visual Basic.NET: how to create a thread to update the UI

你说的曾经没有我的故事 提交于 2019-11-28 10:35:40
The usual VB way to handle a computationally heavy task is to put it in a background worker thread, while the main thread keeps handling the UI. Say for whatever reason I needed to do this the other way around: the main thread doing the grunt work and the background one updating the UI. Here's what I have so far. The only problem is, while the UI window (Form1) does get redrawn, you can't interact with it, not even move or resize it (the mouse cursor turns to hourglass and won't click). Public Class ProgressDisplay Private trd As Thread Public Sub New() trd = New Thread(AddressOf threadtask)