window

Why won't my JFrame respond to mouse and window changes?

我与影子孤独终老i 提交于 2020-01-14 06:36:47
问题 Here is my code: import java.awt.event.*; import java.awt.*; import javax.swing.*; public class wind extends JFrame implements ComponentListener, MouseListener { JButton button; JLabel label; public wind() { // initialise instance variables setTitle("My First Window!"); setSize(400, 200); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); JPanel content = new JPanel(); content.setLayout(new FlowLayout()); content.addComponentListener(this); content.addMouseListener(this); label

How to move WPF UserControl from one window to another?

半城伤御伤魂 提交于 2020-01-13 11:10:55
问题 Let's say I have a UserControl called MyVideoControl located in MainWindow.xaml: <Window Name="_mainWindow"> <Grid> <MyVideoControl Name="_localVideo"/> </Grid> </Window> Now a user clicks a button and I want the UserControl to float on top of the MainWindow.xaml, inside a newly created window called PopUp.xaml. <Window Name="_popUpWindow"> <Grid> <MyVideoControl Name="_localVideo"/> </Grid> </Window> How do I accomplish this, so the entire object gets moved? Currently I use XAML to

Javascript on window resize end

半腔热情 提交于 2020-01-13 10:43:16
问题 I am calling a function when the window is resized like this: window.addEventListener("resize", calculateDimensions()); But I need a way to call a different function AFTER the window has been resized. Is there any way to achieve this using native js (not jquery) TIA 回答1: You could set a Timeout and reset it when resize is fired again. So the last timeout isnt canceled and the function is run: function debounce(func){ var timer; return function(event){ if(timer) clearTimeout(timer); timer =

CGWindowListCopyWindowInfo, kCGWindowLayer and window level

荒凉一梦 提交于 2020-01-13 03:29:29
问题 The CGWindowLevel.h file defines the constants that are used to set the window level and the largest value that can be used as window level is 20. But, if you retrieve the window list using the call CGWindowListCopyWindowInfo , you can observe that the value of kCGWindowLayer is more than 20 (25, 103 etc). Aren't kCGWindowLayer and window level same? If they are not same, how do I get the window level for the windows that are obtained using CGWindowListCopyWindowInfo ? If they are same, why

CMD command to check connected USB devices

和自甴很熟 提交于 2020-01-12 22:24:08
问题 its my first question on stackoverflow so I'm sorry if I don't do that properly. Coming to my question, I would like to obtain, by a command prompt, a list of all USB devices connected to my computer (O.S. Windows 10). I've googled to find such a command, but all results seems useless to me or worse workless. Does anybody know how can I do that? Thank you 回答1: you can download USBview and get all the information you need. Along with the list of devices it will also show you the configuration

CMD command to check connected USB devices

走远了吗. 提交于 2020-01-12 22:22:21
问题 its my first question on stackoverflow so I'm sorry if I don't do that properly. Coming to my question, I would like to obtain, by a command prompt, a list of all USB devices connected to my computer (O.S. Windows 10). I've googled to find such a command, but all results seems useless to me or worse workless. Does anybody know how can I do that? Thank you 回答1: you can download USBview and get all the information you need. Along with the list of devices it will also show you the configuration

Changing FontSize relationally to the windowsize with WPF?

橙三吉。 提交于 2020-01-12 18:18:32
问题 Is it possible, that the FontSize getting smaller if I shrink the window and getting bigger if I enlarge the window? 回答1: Wrap your text inside a Viewbox . <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <Viewbox> <TextBlock Text="Sizes to fit!"/> </Viewbox> </Window> 回答2: I've never tried this, but I imagine you can bind the font size property of your text to the window size through a converter method. I wouldn't try to bind directly, as that way madness lies. The

WPF Window - Only allow horizontal resize

走远了吗. 提交于 2020-01-12 12:09:09
问题 I want to only allow my WPF window to be resized horizontally. How best can I achieve this? 回答1: If you set the MinHeight and MaxHeight attributes of the window to the desired height the window will have a fixed height 回答2: If you want to use the MinHeight and MaxHeight approach but still allow the window to automatically size itself to fit the size of its content: <Window x:Class="MyWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft

SDL2 How to position a window on a second monitor?

爷,独闯天下 提交于 2020-01-12 08:22:09
问题 I am using SDL_SetWindowPosition to position my window. Can I use this function to position my window on another monitor? UPDATE Using SDL_GetDisplayBounds will not return the correct monitor positions when the text size is changed in Windows 10. Any ideas how to fix this? 回答1: SDL2 uses a global screen space coordinate system. Each display device has its own bounds inside this coordinate space. The following example places a window on a second display device: // enumerate displays int

Android - Disable dummy starting window of application

末鹿安然 提交于 2020-01-12 06:42:27
问题 I want to know how to achieve this effect. My app (default everything), when launcher icon is clicked, right away display some kind of a empty dummy window, where nothing is happening and then loads layout into it. "Heavier" apps like YouTube, Drive, Dropbox etc. when started, seem to wait after launch, without showing that dummy window and load right into ready layout. Any idea how to do this or where should I look into? Thanks //EDIT: this has nothing to do with something like loading