focusmanager

Instable focus of WPF apps

拟墨画扇 提交于 2020-01-11 06:48:12
问题 If I have problems with WPF, then it always concerns the Focus-Management. There are cases, my App loses totally focus so that another application gains the focus and my app goes in the background . This happens mainly if some windows in my app will be closed. Is this a known problem of WPF. Does someone else has similar problems? I already opened another thread to this, but no one could help, maybe it was a little to detailed. Therefore this here is the short version. UPDATE It seems that I

How do I use requestFocus in a Java JFrame GUI?

混江龙づ霸主 提交于 2020-01-07 05:53:06
问题 I am given an assignment but I am totally new to Java (I have been programming in C++ and Python for two years). So we are doing GUI and basically we extended JFrame and added a couple fields. Say we have a field named "Text 1" and "Text 2". When user presses enter with the cursor in Text 1, move the focus to Text 2. I tried to add private JTextField textfield1() { textfield1 = new JTextField(); textfield1.setPreferredSize(new Dimension(200, 20)); textfield1.addActionListener( new

How do I use requestFocus in a Java JFrame GUI?

淺唱寂寞╮ 提交于 2020-01-07 05:52:07
问题 I am given an assignment but I am totally new to Java (I have been programming in C++ and Python for two years). So we are doing GUI and basically we extended JFrame and added a couple fields. Say we have a field named "Text 1" and "Text 2". When user presses enter with the cursor in Text 1, move the focus to Text 2. I tried to add private JTextField textfield1() { textfield1 = new JTextField(); textfield1.setPreferredSize(new Dimension(200, 20)); textfield1.addActionListener( new

Xamly set keyboard focus to an element in DataGridTemplateColumn cell?

安稳与你 提交于 2019-12-24 04:52:11
问题 I've set stuff in a DataGridTemplateColumn.CellEditing DataTemplate. I want that when the cell editing loads and shows the template, keyboard-focus should be given to a certain control in the template. Consider this example, when you go edit mode, the textbox is not keyboard-focused: <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <DataGrid

Change focus to next component in JTable using TAB

会有一股神秘感。 提交于 2019-12-18 07:45:00
问题 JTable's default behavior is changing focus to next cell and I want to force it to move focus to next component (e.g. JTextField) on TAB key pressed. I overrided isCellEditable method of DefaultTableModel to always return false: public boolean isCellEditable(int rowIndex, int columnIndex) { return false; } But it still doesn't change focus to next component! How should I make JTable change focus to next component instead of next cell? 回答1: If you really want this, you need to change the

Change focus to next component in JTable using TAB

我只是一个虾纸丫 提交于 2019-12-18 07:44:41
问题 JTable's default behavior is changing focus to next cell and I want to force it to move focus to next component (e.g. JTextField) on TAB key pressed. I overrided isCellEditable method of DefaultTableModel to always return false: public boolean isCellEditable(int rowIndex, int columnIndex) { return false; } But it still doesn't change focus to next component! How should I make JTable change focus to next component instead of next cell? 回答1: If you really want this, you need to change the

setFocus in Flex

情到浓时终转凉″ 提交于 2019-12-12 03:03:48
问题 I'm Using following code in flex4 mxml That works fine. <mx:Button label="Set focus to Username" click="focusManager.setFocus(username);" /> How to use the same in Action script I mean creation complete event of an application without using button. That is I have login panel in application While page loads the username field should focused having cursor in it. Can any one help me? 回答1: The issue is that within your application the TextInput has focus, but within the HTML page your Flex

Is there a focus handler in javafx

徘徊边缘 提交于 2019-12-11 10:13:03
问题 In swing is a FocusManager available to get notified if the focus changes. FocusManager.getCurrentManager().addPropertyChangeListener (...) Is there an analogue way in javafx to get notified if the focus in the scenegraph changes? 回答1: There's none yet but you can try manually looping among the focusedProperties of your target nodes private void handleFocusChangesStartingFromParentNode(Parent parentNode) { for (Node node : parentNode.getChildrenUnmodifiable()) { node.focusedProperty()

Focus navigation in keyBinding

不羁岁月 提交于 2019-12-11 01:59:52
问题 In my form, when i press ENTER button in my keyboard, the okAction() method should be invoke (and invoke perfectly). My problem is in focus state, When i fill the text fields and then press the ENTER button, the okAction() didn't invoked, because the focus is on the second text field (not on the panel). How fix this problem? public class T3 extends JFrame implements ActionListener { JButton cancelBtn, okBtn; JLabel fNameLbl, lNameLbl, tempBtn; JTextField fNameTf, lNameTf; public T3() { add

Focus Textbox using FocusManager.FocusedElement issue

跟風遠走 提交于 2019-12-07 12:15:59
问题 I'm trying to set the keyboard focus to a textbox that is included in a stackpanel. When the IsEditMode becomes true i want the textbox to become, by default, focused. I've tried this code: <DataTemplate x:Key="LibraryItemTemplate"> <StackPanel Orientation="Vertical"> <StackPanel.Style> <Style TargetType="StackPanel"> <Style.Triggers> <DataTrigger Binding="{Binding IsEditMode}" Value="True"> <Setter Property="FocusManager.FocusedElement" Value="{Binding ElementName=TxtB}"/> </DataTrigger> <