java-7

Is it possible to have a translucent windows in java 7 including a title bar?

元气小坏坏 提交于 2019-12-01 01:12:16
问题 Related to this question: Is The Java Tutorials Translucent Window example giving trouble to those playing with jdk7? with jdk1.6.0_26 I seem to be able to apply translucency to a JFrame, but not so with jre7: NativeException: java.awt.IllegalComponentStateException: The frame is decorated ex (jruby scripting java, works jdk1.6 not with jdk7 though): require 'java' class MouseDraw def self.go java_import 'javax.swing.JFrame' java_import 'com.sun.awt.AWTUtilities' f = JFrame.new AWTUtilities

IntelliJ switch statement using Strings error: use -source 7

扶醉桌前 提交于 2019-11-30 23:38:43
问题 I'm trying to use IntelliJ (on Mac OS X) to compile some code I wrote using Eclipse. I've attempted to run the following code: switch (category) { case "below 20": below20++; break; case "20 to 29": to30++; break; case "30 to 39": to40++; break; case "40 to 49": to50++; break; case "50 to 59": to60++; break; case "60 to 69": to70++; break; case "70 t0 79": to80++; break; case "80 to 89": to90++; break; case "90 to 99": above90++; break; default: break; } However, I get the error: java:

Schema generation with EclipseLink and Hibernate (JPA2.1) - @ForeignKey ignored

不羁岁月 提交于 2019-11-30 22:58:47
I am testing JPA2.1 and the new "schema generation" feature. For that, I tested two implementations under the HyperSQL database : EclipseLink 2.5.2-M1 which is the reference implementation. Hibernate 4.3 I don't have any preference for an implementation (not even for performance). I tested EclipseLink because it was the first JPA2.1 implementation available, but now, Hibernate 4.3 is here and JPA2.1 compliant. The only thing I want is to get something independent from the JPA provider - except for the configuration (like cache, logging, static weaving, ...). As for schema generation, several

Overriding single classes from rt.jar

好久不见. 提交于 2019-11-30 22:53:38
I'm looking for a neat way to override a class from the bootstrap class path, rt.jar . The reason is OpenJDK7 bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7104625 The fix for this bug is a trivial (see linked mailing list post) change to sun.awt.X11.XComponentPeer . So I was wondering if there is an easy way to override just this one affected class on my classpath, without having to repack/rebuild rt.jar (so the fix isn't lost on the next automatic update of OpenJDK). Ideally, it would also affect Eclipse... I assume that java -Djava.system.class.loader=myClassLoader would work? Is

Are Project Coin's collection enhancements going to be in JDK8? [closed]

落花浮王杯 提交于 2019-11-30 22:31:16
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Initially Project Coin had enhanced support for collections e.g. list[3] instead of list.get(3) and map["hello"] = 27 instead of map

JRE 1.7 Vulnerability

故事扮演 提交于 2019-11-30 21:11:01
Today, our Enterprise Architect mentioned that a recent vulnerability was discovered in the JRE 1.7. I found an article the JRE 1.7 vulnerability recommending disabling Java . I am running JDK 1.5 and 1.6 at work (like many organizations, we're not on the latest of technologies), so no problems there. At home I am doing development with Java SE 7u6. I'm playing with Grails, Spring Security, trying to keep learning. I have already gone and disabled the Java Plug-in in all my browsers on my home development machine. However, does anyone know if my home dev machine is still vulnerable by virtue

Why does isAnnotationPresent work differently between Java 7 and Java 8?

浪子不回头ぞ 提交于 2019-11-30 20:49:26
I just discovered this today when one of my unit tests failed because of upgrading from Java 7 to Java 8. The unit test calls a method which tries to find an annotation on a method which is annotated on a child class but with a different return type. In Java 7, isAnnotationPresent seems to only find annotations if they were really declared in code. In Java 8, isAnnotationPresent seems to include annotations that were declared in child classes. To illustrate this I created a simple (??) test class IAPTest (for IsAnnotationPresentTest). import java.lang.annotation.Retention; import java.lang

What is the status of Java superpackages?

半腔热情 提交于 2019-11-30 20:26:09
In JSR 294 the superpackage feature for Java is specified. It should debut in Java 7, but the JSR is marked as inactive and Java 7 was released half a year ago. Definite information on superpackages are somewhat hard to come by on the net, there are numerous articles on the 'upcoming superpackages', but hardly any on the current state of the feature. So my question is: What is the status of the feature? I believe it is now called modules and should be part of Java 8 Java 9 - you can find more information in JSR 337 (search for module on the page). Modules are covered by Project Jigsaw . 来源:

Java 7u4 webstart security exception: Class does not match trust level

我的未来我决定 提交于 2019-11-30 20:19:51
We began to notice that with Java 7 (particularly with update 4), that all our users began to see this with our Webstart app: [14:42:58,422] AWT-EventQueue-0(DEBUG) java.lang.SecurityException: class "CLASSNAME" does not match trust level of other classes in the same package [14:42:58,422] AWT-EventQueue-0(DEBUG) at com.sun.deploy.security.CPCallbackHandler$ChildElement.checkResource(Unknown Source) [14:42:58,422] AWT-EventQueue-0(DEBUG) at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source) [14:42:58,422] AWT-EventQueue-0(DEBUG) at com.sun.deploy.security

How to import and use com.sun.jdi.VirtualMachine

孤者浪人 提交于 2019-11-30 18:02:12
I found some classes designed for debugging in package com.sun.jdi like VirtualMachine , but I can't use this because package seems not exist in Sun JDK7. How to use this package? BTW. lib/sa-jdi.jar isn't the same I want According to this page , the VirtualMachine class that you linked to is part of the tools.jar file which is only distributed in a JDK (not a JRE). It says ... " Update Note 2: The Attach API is in tools.jar, so you will need to add /lib/tools.jar in your CLASSPATH to compile and run the example on JDK 6." ... and the same advice would apply on (at least) JDK 7 as well. 来源: