jjzjj

custom-component

全部标签

Java Swing : Enabling/Disabling all components in JPanel

我有一个JPanel,其中包含一个JToolbar(包括几个没有文本的按钮)和一个JTable,我需要启用/禁用(使内部小部件不可点击)。我试过这个:JPanelpanel=....;for(Componentc:panel.getComponents())c.setEnabled(enabled);但它不起作用。是否有更好、更通用的解决方案来启用/禁用JPanel中的所有内部组件?从这里的示例开始,我已经使用JLayer部分解决了我的问题http://docs.oracle.com/javase/tutorial/uiswing/misc/jlayer.html:layer=newJ

java - org.codehaus.plexus.component.repository.exception.ComponentLookupException : java. util.NoSuchElementException

我尝试测试我的Maven插件并收到奇怪的异常。发现类似问题here,但答案没有帮助。pom.xmlorg.apache.mavenmaven-plugin-api3.3.9org.apache.mavenmaven-project3.0-alpha-2com.jcabijcabi-aether0.10.1org.apache.maven.plugin-toolsmaven-plugin-annotations3.4providedorg.apache.maven.plugin-testingmaven-plugin-testing-harness3.3.0testorg.apache.

java - 启动 Neo4j 失败 : Component was successfully initialized, 但未能启动

我正在学习Pluralsight上的Neo4J教程,我必须使用drwho(神秘博士)示例数据库。我正在使用Neo4j社区版3.0.1版。但是示例数据库(drwho)是由旧版本制作的,我必须将dbms.allow_format_migration属性设置为"true"。这样做之后,当我尝试启动服务器时,它弹出了这个错误StartingNeo4jfailed:Component'org.neo4j.server.database.LifecycleManagingDatabase@673b0b17'wassuccessfullyinitialized,butfailedtostart.Pl

java - @Component 和@Repository/@Service 注解的处理方式有什么区别?

我今天在使用Spring3.0时偶然发现了一个相当奇怪的问题:有一个抽象类A及其具体实现A_Impl.A_Impl注释为@Repository并由Spring自动扫描(和都在上下文中声明)。A和A_Impl部署在单独的JAR中(不确定这是否重要)。一切正常。现在,我正在审查该代码和@Repository在语义上似乎不太合适(所讨论的类与持久性无关)所以-以我无限的智慧-我决定将其更改为更通用的@Component.不用说,一切都爆炸了,让我看起来像个彻头彻尾的白痴。错误(在Spring上下文初始化期间发生)是Spring的ClassPathResource.getInputStream

java - Spring @Component 类必须是公开的吗?

我想将组件的接口(interface)公开为接口(interface),实现类将受到包保护(可能在其他包中):packagebaz.ifaceinterfaceFoo{voidbar();}packagebaz.whatever@ComponentclassSpringyFooimplementsbaz.iface.Foo{publicvoidbar(){frobnicate();}}假设baz.whatever在component-scan中,Spring是否能够在其他地方Autowiringbaz.iface.Foo?classFooClient{@Autowiredprivate

java - 正确使用 Facelet 模板和复合组件

我仍然不确定如何正确使用JSF模板和复合组件。我需要创建一个企业Web应用程序,其中会有很多页面。每个页面都有相同的页眉、菜单、页脚,当然还有不同的内容(=JSF模板)。每个页面上的内容都将由可重用的“框”(=JSF复合组件)组成。这些盒子由一些文件、按钮等组成。我的解决方案是否合适?或者我应该使用其他技术,如自定义组件、装饰......?布局.xhtml客户概览.xhtml:...component_case_history.xhtml...CustomerOverviewController.java@ManagedBean@ViewScopedpublicclassCustome

java - 同一个类上注解Entity和Component是不是错了

将来自spring@Component和JPA@Entity的注释放在同一个类上是错误的想法吗?为什么需要它是在JSF页面上使用这个类,它还描述了表结构。原因是为了避免将实体对象映射到将成为表示层的某个值对象。这是一些反模式吗?你有更好的解决方案吗? 最佳答案 Isitwrongideatoputannotationfromspring@ComponentandJPA@Entityonthesameclass.这是Controller和模型的紧耦合。WhyItisneededistousethisclassonJSFpageanda

java - Spring 3 注释配置选择@Configuration 和@Component 但不是@Controller

因此,我尝试在没有XML的情况下配置我的网络应用程序,并采用所有带注释的路线。我有几个用@Configuration和@Component注释的类,它们会自动获取,但由于某些原因,我的@Controller注释没有被识别并映射到它们相应的@RequestMapping值。我的web.xml文件如下所示:timbuk2-webapp-Compositorlog4jConfigLocation/WEB-INF/conf/log4j-config.xmlcontextClassorg.springframework.web.context.support.AnnotationConfigWe

java - 将 Java ArrayList<Custom Class> 转换为 ArrayList<Object>

我正在尝试将SomeClass类的ArrayList转换为Object类的ArrayList。Object的这个新的ArrayList将被传递给一个函数。我目前做了以下事情://convertArrayListtogenericArrayListObject[]objectArray=someClassList.toArray();ArrayListobjects=newArrayList();for(inti=0;iobjects){//dosomethingwithobjects}是否有更有效或“标准”的方法来做到这一点?首先我做的是“错的”吗?将其转换为Object类的Array

java - Spring 安全 : Custom UserDetailsService not being called (using Auth0 authentication)

我是Spring框架的新手,所以对于我理解中的任何漏洞,我提前表示歉意。我正在使用Auth0来保护我的API,它运行良好。我的设置和配置与suggestedsetup相同在Auth0文档中://SecurityConfig.java@Configuration@EnableWebSecurity(debug=true)publicclassSecurityConfigextendsWebSecurityConfigurerAdapter{//auth0configvarshere@Overrideprotectedvoidconfigure(HttpSecurityhttp){JwtW