Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Reyada Wolak

Greenhorn
+ Follow
since Mar 28, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Reyada Wolak

another option is to store the image as Bytes in the DB (BLOB) is DB is used.
8 years ago
Hi,

I have an application and i want to secure my icons and logo from being used by others once the application is distributed. i have seen some applications has their icons as *.class file instead of the real image. how can i do this?
9 years ago

sasi kala wrote:Hi vijay,

The behavior of ItemListener is like that only.
It will call itemStateChanged two times because,
one of the item lost focus,
another one gains focus.
so it will call two times.

My suggestion is use ActionListener , and write actionPerformed like this


Hope This Helps.
All The Best



i tried to setFocusable(false) and it works just fine.
9 years ago
I'm facing the same thing. any hint of what could be the problem. i tried this on two machines (Windows 7 32 and 64 bit). it happens on the 64bit only.
10 years ago
it means that the input language didn't change from en_US (default locale) to ar_X
i.e. i need to specify the country code or it will not work.

the selectInputMethod() return false in case of Locale("ar"), the same as Locale("en")

there is no bug in the implementation but i need to know how do i get the enabled input language (not the list of the supported languages since i cannot select them unless the user add them from the control panel)
10 years ago
Hi,
i'm using selectInputMethod(new Locale("ar", "AE")) to set the locale for my application. this works fine but the problem is that i should specify the country code as well e.g. "AE", without this it will not work e.g. new Locale("ar")
Arabic language is the same for all countries so the country is not a matter here. i don't know which country code language is installed in the user PC. i want the application to select any Arabic language installed in the user PC.
Locale.getAvailableLocales() is not giving me what i need. it gives all the supported languages in the OS but not the ones that are enabled by the user.
i ended up duplicating selectInputMethod for all the country codes i.e.:

this.getInputContext().selectInputMethod(new Locale("ar", "DZ"));
this.getInputContext().selectInputMethod(new Locale("ar", "IQ"));
this.getInputContext().selectInputMethod(new Locale("ar", "JO"));
this.getInputContext().selectInputMethod(new Locale("ar", "LB"));
this.getInputContext().selectInputMethod(new Locale("ar", "LY"));
this.getInputContext().selectInputMethod(new Locale("ar", "MA"));
this.getInputContext().selectInputMethod(new Locale("ar", "OM"));
this.getInputContext().selectInputMethod(new Locale("ar", "SD"));
this.getInputContext().selectInputMethod(new Locale("ar", "SY"));
this.getInputContext().selectInputMethod(new Locale("ar", "TN"));
this.getInputContext().selectInputMethod(new Locale("ar", "YE"));
this.getInputContext().selectInputMethod(new Locale("ar", "QA"));
this.getInputContext().selectInputMethod(new Locale("ar", "KW"));
this.getInputContext().selectInputMethod(new Locale("ar", "BH"));
this.getInputContext().selectInputMethod(new Locale("ar", "EG"));
this.getInputContext().selectInputMethod(new Locale("ar", "SA"));
this.getInputContext().selectInputMethod(new Locale("ar", "AE"));

this will pick certainly one Arabic language in the user PC.

Is there any other better way?
10 years ago
Thanks a lot Steve. your examples helps me to understand the idea. Also I came to know a new class BlockingQueue which does a good job for me.
I'm trying to modify my code accordingly.

Thanks a gain.
Thanks Steve for your help.

I tried to find a way to implement your suggestion without success. I don't know a lot about 'Event-Dispatch-Thread'. I would really appreciate if you give me an example or a link to a tutorial on how to do this.

Actually my application is trying to control MPlayer (in slave mode) through its output stream and getting the answers from the input stream. I'm using a base code from:
http://beradrian.wordpress.com/2008/01/30/jmplayer/

On the other hand, I faced a lot of problems in using PipedInputStream/PipedOutputStream since they are *sometimes* start to consume a lot of CPU in idle cases. So I remove them and use wait()/notify() to replace the waitForAnswer() function.

I couldn't make it works.
I appreciate your comments

K. Tsang wrote:And the JFrame is Q class is really pointless - just makes thing annoying.



Sorry, I was only trying to put the same code as in my application.

K. Tsang wrote:what is the Q class waiting for?


Steve Luke wrote:Why do you need to use wait()?


I'm developing an application that reads the logs from the output (shell) of a native application. I'm waiting until specific line is displayed (output) and then I use a notify() to release the synchronized function.
Hi,

I'm trying to use wait() in a synchronized method in my application. on the other hand it seems 'synchronized' is not blocking other threads to access it. I prepared the a sample code to test it:

Q.java
******


S.java
******

**********

if you run S.java and start pressing the button, you will see:
start
start
start
start
start

That means the method is not exit and another thread start execute it again. If you replace wait() with Thread.sleep() it works as expected:
start
end
start
end
start
end

On the other hand i need to use wait() and not sleep() in my case.

I appreciate any help

thanks