所以我的问题,正如标题中所说的那样,是关于Javafx(即2.2)Popup在某些方面的行为.大多数情况下,你得到一个弹出窗口,你给它一个窗口作为它的父母,你给它一些场景,它往往相对独立.
这一切都很好,但是,在我的情况下,当事件发生时,我需要一个弹出窗口,将其自身锚定到特定位置(窗口),特定位置.然后,当窗口消失时(最小化,屏幕外,无论如何),弹出窗口将会消失,当它完全移动时,并且在所有的本质和功能中,只需使用自定义形状,就可以成为窗口的物理扩展.
当然,现在有很多细微差别,而且大部分内容都很有效.我似乎无法弄清楚的唯一一件事就是通常在像Windows 7 64位这样的平台上.你打开两个程序,好吧.然后,如果程序重叠一点,无论哪个有焦点都可以显示整个程序,而另一个给出的印象是"在另一个窗口后面".(当另一个人专注于同一个地方时,无论窗口是否实际上将应用程序图形渲染到窗口后面,我都不确定.)通常,javafx也支持这个功能.但出于某种原因,javafx中的Popup类(参见此处的文档)并没有这样做.无论如何,它始终位于显示的任何内容之上.为了完整性,这里是我非常简单的弹出代码(至少有关于显示它和它的属性的部分):
Popup myPop = new Popup();
//************************Popup Property Setter**************************
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
myPop.setWidth(width);
myPop.setHeight(initialHeight);
myPop.setAutoHide(false);
myPop.setAutoFix(false);
myPop.setHideOnEscape(false);
myPop.setX(xLocation);
myPop.setY(yLocation);
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
//**********************end of Popup Properties**************************
myPop.getContent().add(main_anchor);
myPop.show(FileChooserWindow.get_stage());
Run Code Online (Sandbox Code Playgroud)
main锚有一些不同的组件,我包含在'myPop'弹出窗口内,而FileChooserWindow是一个非null的父窗口,在此方法调用时将无异常地打开.
这是我所指的行为的截图.请注意pdf中突出显示的文本,即我的光标当前具有焦点的位置.此外,弹出窗口固定的窗口可以在从左侧戳出的pdf背面看到. 
你们给予的任何帮助都将非常感激.我真的希望我不必检查活动进程和它们相对于弹出窗口的位置,这种方式越来越接近我的知识边界,听起来就像一个完整的PITA.
我有一个生成如下表的查询:
Login_Date Username
----------------------------------------------
1/1/10 user-1
1/1/10 user-1
1/1/10 user-2
1/2/10 user-1
1/2/10 user-2
1/3/10 user-1
1/3/10 user-1
1/3/10 user-1
1/3/10 user-3
Run Code Online (Sandbox Code Playgroud)
查询如下所示:
SELECT Date_Used, Name AS licenseNames FROM B, A WHERE A.License_Key = B.License_Key ORDER BY Date_Used ;
Run Code Online (Sandbox Code Playgroud)
这很好,但我需要它来生成日期列表,对于每个日期,它都会为我提供当天登录的用户列表,以及他们登录的次数。我已经查看了所有内容试图找到一个简洁的解决方案,但这只是死胡同。
我想要发布的结果如下所示:
Login_Date Username # of Times logged in
--------------------------------------------------
1/1/10 user-1 2
1/1/10 user-2 1
1/2/10 user-1 1
1/2/10 user-2 2
1/3/10 user-1 3
1/3/10 user-3 1
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激,这让我发疯。
编辑
以下是相应的表格,以避免混淆:
表 A 列:
--------------------------
ID License_Key Name
Run Code Online (Sandbox Code Playgroud)
表 B 列: …
我们使用许多基于Spring安全性构建的spring boot项目来提供用于多种目的的小型Web应用程序.我们正在考虑转而使用Crowd作为中央身份验证提供程序,但是我在配置使用java风格bean而不是提供的XML配置的spring boot方面遇到了很多麻烦,因为这不再是推荐的配置(请参阅http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#using-boot-configuration-classes以验证java-bean样式配置是首选方式).
我的安全基本测试应用程序的安全配置设置如下:
WebSecurityConfig.java
package hello;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/", "/home").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.permitAll()
.and()
.logout()
.permitAll();
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.inMemoryAuthentication()
.withUser("user").password("password").roles("USER");
}
}
Run Code Online (Sandbox Code Playgroud)
我真的很难过如何修改它以适应Crowd内置的springsecurity集成.(特别是com.atlassian.crowd:crowd-integration-springsecurity:2.8.3).我试图用来尝试通过标准配置注释类来引导功能的XML如下:
的applicationContext-security.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<!-- …Run Code Online (Sandbox Code Playgroud) 问题非常简单,在javafx 2.2中的一个阶段,其中最大化不是一个选项(通过从菜单栏中取消控制)但是需要允许最小化,是否可以在代码中取消最小化舞台?
我尝试过的东西(我可以访问静态阶段):
stage.show();
stage.requestFocus();
stage.toFront();
stage.getScene().getWindow().requestFocus();
Run Code Online (Sandbox Code Playgroud)
Platform.runLater(new Runnable(){public void run(){
stage.show(); stage.requestFocus(); stage.toFront(); stage.getScene().getWindow().requestFocus();}}) ;
没有任何影响.我尝试使用Google搜索,并且只提出了解决方案,因此首先不允许用户最小化,这对我来说真的不是一个选择.
无论如何,如果有人有一个聪明的主意,我会全力以赴.该程序使用了一些带有c的jni,所以本机调用并不是不可能的,但我会认为这真的是最后的手段.
值得注意的是,这是在javafx 2.2 jdk 7_bu52 Windows 7 64位上