background preloader

Searchplusplus_issue

Facebook Twitter

JComboBoxで候補一覧を表示 - Java Swing Tips. 概要 JComboBoxに入力候補の一覧表示機能(補完機能、コードアシスト、コンテンツアシスト)を追加します。

JComboBoxで候補一覧を表示 - Java Swing Tips

サンプルコード String[] array = { "aaaa", "aaaabbb", "aaaabbbcc", "aaaabbbccddd", "abcde", "abefg", "bbb1", "bbb12"}; JComboBox combo = new JComboBox(array); combo.setEditable(true); combo.setSelectedIndex(-1); JTextField field = (JTextField) combo.getEditor().getEditorComponent(); field.setText(""); field.addKeyListener(new ComboKeyHandler(combo)); view all 解説 上記のサンプルでは、次のキー操作に対応しています。

UpDownキー ポップアップ表示Escキー ポップアップ非表示Rightキー 補完Enterキー 選択、または追加文字入力 候補をポップアップ JComboBox#showPopup()とJComboBox#hidePopup()(それぞれ、JComboBox#setPopupVisibleメソッドをラップしているだけ)を使って、候補のポップアップメニュー表示を制御します。 JComboBox#setSelectedIndex(-1)で、項目の選択をクリアしないと動作がおかしくなる場合があります。 JComboBoxではなく、SwingSet3のJHistoryTextField.java のように、JTextField+JPopupMenuを使用することもできますが、画面の下側で候補数が変更された場合のJPopupMenuの位置更新(気にしなければ問題無し)が面倒です。 コメント. Java - Reading UTF-8 - BOM marker. Login.srf?wa=wsignin1.0&rpsnv=12&checkda=1&ct=1424319363&rver=6.5.6509.0&wp=LBI&wreply=http:%2F%2Fsupport.microsoft. PDF 圧縮 – オンラインでPDFを無料で縮小できる! JNotify - About. Java高效监控目录. GDI Objects. Downloads - luke - Luke - Lucene Index Toolbox. SWTメモ - レイアウト編. 最終更新日:2005/01/12 目次 はじめに Swingと同じくSWTにもレイアウト・マネージャがあります。

SWTメモ - レイアウト編

用意されているレイアウト・マネージャはJavaのAWTのレイアウトに近いと言えば近いのですが、慣れるまではどのレイアウト・マネージャを使ってどうレイアウトすればよいのか悩むのではないでしょうか。 そこでいくつかの画面構成を例として挙げ、それらに対するレイアウト方法を例として紹介します。 レイアウトを理解する近道 例を紹介する前に、SWTのレイアウトを理解するために有用な情報源を紹介します。 SWTアプリケーションでのレイアウト SWTの5つのレイアウトについて詳細に解説されています(日本語)。 Understanding Layouts in SWT EclipseのサイトにあるSWTレイアウトの解説(英語)。 SWT Example Launcher(EcilpseのPlugin) Eclipse Downloadsから適当なダウンロードサイトを選択して、使用しているEclipseバージョン番号をクリックし、Example Plug-insからプラットフォームに合ったファイルをダウンロードして展開します。 レイアウト・マネージャ SWTで用意されているレイアウト・マネージャは以下の5つです。 この中で使用頻度が最も高いのはGridLayoutではないでしょうか。 サンプル其の1 - ファイルパス選択 画面構成 ファイルやディレクトリパスを入力するテキストフィールドと、ファイル/ディレクトリ選択ダイアログを開くボタンがセットになった、以下のような画面を考えます。 レイアウト まずどのレイアウト・マネージャを使うかですが、FillLayoutは各Widgetを均等サイズに設定するので上の画面構成には適用できません。

そうすると消去法でRowLayoutかGridLayoutのどちらかになります。 画面構成はWidgetが3つ横に並んでいるので、GridLayoutのカラム数を3にし、テキストフィールドを配置する二つ目のGridを水平方向に引き伸ばす設定にすれば良いでしょう。 GridLayoutの作成 GridLayoutを生成するには引数を2つ持つコンストラクタを呼び出すと良いでしょう。 GridLayout layout = new GridLayout(3, false); Eclipse Corner Article: Understanding Layouts in SWT. Overview When writing applications in the Standard Widget Toolkit (SWT), you may need to use layouts to give your windows a specific look.

Eclipse Corner Article: Understanding Layouts in SWT

A layout controls the position and size of children in a Composite. Layout classes are subclasses of the abstract class Layout. SWT provides several standard layout classes, and you can write custom layout classes. In SWT, positioning and sizing does not happen automatically. The diagram below illustrates a few general terms that are used when discussing layouts. The preferred size of a widget is the minimum size needed to show its content. Standard Layouts The standard layout classes in the SWT library are: Phrase search. Refreshing the Notification Area (System Tray) Posted by smknight on August 3, 2013 Because I am forcibly killing certain processes regularly, I end up with orphaned icons in what is apparently called the Notification Area, not the System Tray.

Refreshing the Notification Area (System Tray)

I found a good StackOverflow answer, but it needed some updates:Can you send a signal to Windows Explorer to make it refresh the systray icons? The answer draws its information from this informative post:REFRESHING THE TASKBAR NOTIFICATION AREA But the information is from 2008. The name of the window used in XP has changed in Windows 7 (actually probably in Vista). Utility available here: Refresh Notification Area By the way, if you have the opposite problem as me and are losing the icons of programs still running, see the following:Can I re-gain a systray icon of a running app that has gone missing? I’ve posted my updates to the StackOverflow answer: Comments comments. How to apply and refresh the change to Notification Area? よしいずの雑記帳 MinGWでWindowsプログラミングを行う方法. C言語+Win32 APIでWindowsプログラムを書き、MinGWでコンパイルする手順。

よしいずの雑記帳 MinGWでWindowsプログラミングを行う方法

今回の内容のポイントは、以下の3点です。 ヘッダファイル「windows.h」をインクルードするエントリポイントは、main関数ではなく「WinMain関数」であるgccコマンドによるコンパイル&リンク時に「-mwindowsオプション」を付加する Windows XP上での作業を前提としています。 MinGWのWindows XPにおけるセットアップ方法については、以下の記事をお読みください。 → Windows XPにおけるC言語およびC++のセットアップ作業のメモ サンプルプログラムとコンパイル方法 以下のようなプログラムを作成し、「sample.c」という名前で保存したとします。 #include <windows.h> #include <tchar.h> int WINAPI WinMain( HINSTANCE hCurInst, HINSTANCE hPrevInst, LPSTR lpsCmdLine, int nCmdShow) { MessageBox( NULL, _T("Hello, Windows!

") これをコンパイルするには、コマンドラインにおいて、cdコマンドでソースファイルのあるディレクトリ(=フォルダ)に移動したのち、gccコマンドを-mwindowsオプション付きで実行します: > gcc sample.c -o sample -mwindows そうすると、実行形式のファイル「sample.exe」ができあがります(厳密に言うと、gccコマンドはコンパイルのあとリンクも行います)。 [SOLVED] How to refresh system tray?