Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!

Ahmet Aksoy

Ranch Hand
+ Follow
since Apr 04, 2005
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 Ahmet Aksoy

Michael,
Thank you very much for the sample code.
I think the trick is setting "null".
I will try to implement it in my project.
Best regards.
Ahmet Aksoy
15 years ago
I tried pack(), validate(), invalidate() but it didn't help.
15 years ago
I have a JFrame which contains a JSplitPane.
In the JSplitPane, there are 2 JPanels.
Normally second JPanel is invisible, but when the
user presses a button it will become visible.
I want the JFrame to be resized automatically.
When it shows a single panel, its size will shrink;
and when it shows both panels it will become larger.
How can I do that?
Thanks.
Ahmet Aksoy
15 years ago
You might be right!
I found some small clues for c# at http://www.codeproject.com/csharp/kbdListenerPackage.asp
I'll try to check WinAPI also.
Thanks.
Ahmet Aksoy
Hi Norm Radder,

I'm not sure whether I must use threads for such a solution, or not.
However, in order to capture the strings copied to the clipboard, I had used threads, and I thought that I could use them for a more complicated problem also.
First, I will try to make a small listener program. It will listen to the keyboard, and the mouse and it will printout the location and the related values of them.
If I can succeed it, then I will try to select the words under the cursor, using ctrl-right click.
At the last step, I will try to copy the selected word to the clipboard.

There is another solution for my problem: "Character Recognition" from the screen. But that will be a far more difficult solution

Ahmet Aksoy
Hi Mr. C Lamont Gilbert,
Here are my expectations: (now I'm talking about only the windows system)
My program will be waiting on the system tray until the user hits ctrl-right click. By using a focusListener, I hope to know the object which had focus when the mouse clicked, and the key pressed. After then I will send a double-click from my thread. Since there will be no visual part of the thread, there will be no change in the focus, and double clicking will make the word to be selected which was shown by the cursor. After then the thread will send a Ctrl-C in order to copy the selected word to the system clipboard.
When user presses ctrl-right-click, my thread will capture it, and change to a double-click, and then a ctrl-C.
My application can now listen to the clipboard events, and capture the copied text into it automatically. So, I will obtain the word which was under the cursor.
I don't know yet whether I can succeed that scenario or not?
I want to find some clues.
Ahmet Aksoy
Hi,
I have a dictionary program. It will run continuously in the background.
When the user clicks ctrl+rightMouseButton, it will select the word at the focus, and send it to the dictionary module.
In order to do that, I think I have to use several threads:
1- For the application waiting in the background
2- Listening for the keyboard events in general
3- Listening for the mouse events in general
4- Listening for the focusing events
5- Listening for the clipboard events (already running)

There will be at least 2 hotKeys: one for program activation, and one for the word selection.
When word selection key activated, I will send a double-click to the component at the focus in order to select the word at the focus, and then send a ctrl-c to copy the selected word to the clipboard.
How should I run those threads altogether?
While listening for the clipboard, there is a sleep(100) method. What does happen during that period? Does waiting affect only that thread, or the whole application? Will it affect the general performance of the application?
As you can see easily, I know very little about threads.
What can I do? What should I do?
Especially I need some simple samples.
Thanks in advance.
Ahmet Aksoy
Hi Sameer,
Thank you for your explanations, and the links.
However, I found the answer to my question:
setDefaultCloseOperation(HIDE_ON_CLOSE);
Ahmet Aksoy
15 years ago
Hi Michael,
Many thanks for your explanatory answer, and the neat sample code.
My problem is solved.
Ahmet Aksoy
15 years ago
Hi,
I want my application to be sitting on the System Tray.
In order to achieve this, I want my program to hide itself when Exit button is pressed, or exit(0) method is called internally. The program must be closed only by the SystemTrayIconManager.
How can I do that?
Ahmet Aksoy
15 years ago
Hi,
There is a nice PLAF (Pluggable Look And Feel) installer at the following address:
http://www.moniundthomaskuenneth.de/tkplafutility/
You can install new LAF's to your system. (I tried for LiquidLookAndFeel on WinXP. It works OK. )
Ahmet Aksoy
15 years ago
Hi,
I have a multi-language application.
Sometimes I need fonts to be changed while working.
I use JFontChooser in order to select a new font, then call the changeFonts(sf) method.
In the first call of changeFonts(sf) everything works as expected. However, when I call the same method with a different sf parameter for a second, or more calls nothing happens.
What might be the problem?
Ahmet Aksoy

/** AnaPanel.java **/
...
changeFonts(sf);
...
void changeFonts(Font sf){
UIManager.put("Button.font",sf);
UIManager.put("ToggleButton.font",sf);
UIManager.put("RadioButton.font",sf);
UIManager.put("CheckBox.font",sf);
UIManager.put("ColorChooser.font",sf);
UIManager.put("ToggleButton.font",sf);
UIManager.put("ComboBox.font",sf);
UIManager.put("ComboBoxItem.font",sf);
UIManager.put("InternalFrame.titleFont",sf);
UIManager.put("Label.font",sf);
UIManager.put("List.font",sf);
UIManager.put("MenuBar.font",sf);
UIManager.put("Menu.font",sf);
UIManager.put("MenuItem.font",sf);
UIManager.put("RadioButtonMenuItem.font",sf);
UIManager.put("CheckBoxMenuItem.font",sf);
UIManager.put("PopupMenu.font",sf);
UIManager.put("OptionPane.font",sf);
UIManager.put("Panel.font",sf);
UIManager.put("ProgressBar.font",sf);
UIManager.put("ScrollPane.font",sf);
UIManager.put("Viewport",sf);
UIManager.put("TabbedPane.font",sf);
UIManager.put("TableHeader.font",sf);
UIManager.put("TextField.font",sf);
UIManager.put("PasswordFiled.font",sf);
UIManager.put("TextArea.font",sf);
UIManager.put("TextPane.font",sf);
UIManager.put("EditorPane.font",sf);
UIManager.put("TitledBorder.font",sf);
UIManager.put("ToolBar.font",sf);
UIManager.put("ToolTip.font",sf);
UIManager.put("Tree.font",sf);

config.applyLookAndFeel(config.LOOK_AND_FEEL);
}
...

/** config.java **/
...
public void applyLookAndFeel(String name){
try {
UIManager.setLookAndFeel(name);
Frame frames[];

frames= Frame.getFrames();
SwingUtilities.updateComponentTreeUI(frames[0]);
frames[0].pack();
frames[0].repaint();

if(LOOK_AND_FEEL.equals(name)==false)LOOK_AND_FEEL=name;
}catch (Exception e) {

System.out.println("Error: "+e.toString());
}
}
...
15 years ago
Thanks Jared,
I'll try it as soon as possible.
Cheers,
Ahmet Aksoy
15 years ago
Can an application read the resources outside of its own directory structure after a Web Start installation?
15 years ago
Hi,
I want to install my application, and many empty dictionary directories using Web Start.
After the installation, the required directory structure will be ready (but empty).
Then, if I copy the required dictionary files into the related directories, is it possible to let my application to read those new resources?
Ahmet Aksoy
15 years ago