resources

getClass().getResource() always returning null

假如想象 提交于 2019-12-17 16:44:39
问题 I am trying to set the URL of an image that is located in my resource folder in my src folder. It is always setting the URL to null. The image is there and everything is named correctly. What is the issue? Thanks! My file structure: sp1 src resources 01.png Here is my code where I am trying to set the URL for the picture: this.setImagePath(getClass().getResource("/resources/01.png")); And the setImagePath is doing this, I am sure this is not the problem, because I followed the execution and

Setting application locale to pt_BR programmatically

拟墨画扇 提交于 2019-12-17 16:44:22
问题 I have an application that has support for the Portuguese language, both for Portugal and Brazil regions. I have created a values-pt (containing the Portugal translation) and values-pt-rBR (containing the Brazilian translation). I then tried changing the application language to Potuguese (Portugal) and the application language changes correctly. When I set it to Portuguese (Brazilian) it does not. I tried changing the phone default language to Portuguese (Brazilian) and it still does not work

VAADIN cannot find themes when in productionMode

半腔热情 提交于 2019-12-17 16:30:51
问题 I have custom theme for my VAADIN application in src/main/webapp/VAADIN/themes/mytheme/ with files mytheme.scss and styles.scss. Everything works fine when the vaadin productionMode deployment parameter is set to false in web.xml. When I set the parameter to true, suddenly Vaadin cannot find the resources for my theme and keeps complaining with: Requested resource [/VAADIN/themes/mytheme/styles.css] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your

WPF throws “Cannot locate resource” exception when loading the image

白昼怎懂夜的黑 提交于 2019-12-17 16:30:31
问题 I am having a WPF window, with a background image of one file in my local system. So the XAML file looks like this: <Window.Background> <ImageBrush ImageSource="/MYASSEMBLY;component/Resources/MyPic.png"/> </Window.Background> In the XAML designer it actually shows this background image, so the image does exist in MYASSEMBLY\Resources folder. However, in the InitializeComponent() function call when I launch the application, it throws the exception Cannot locate resource 'resources/mypic.png'.

VAADIN cannot find themes when in productionMode

醉酒当歌 提交于 2019-12-17 16:28:53
问题 I have custom theme for my VAADIN application in src/main/webapp/VAADIN/themes/mytheme/ with files mytheme.scss and styles.scss. Everything works fine when the vaadin productionMode deployment parameter is set to false in web.xml. When I set the parameter to true, suddenly Vaadin cannot find the resources for my theme and keeps complaining with: Requested resource [/VAADIN/themes/mytheme/styles.css] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your

Loading a file relative to the executing jar file

元气小坏坏 提交于 2019-12-17 16:07:51
问题 The question says it all. The specialty in my case is that the current working directory is not the location of the jar file but c:\Windows\system32 (My jar file is started by windows using the right-click-menu, i want to pass a folder's path as a parameter to the jar). Now I want to load a configuration file called config.xml that is in the same folder as the jar. The purpose of the file is, of course, to provide settings for the jar. It is important for me that the xml file is outside of

No access to Bundle Resource/File (OSGi)

做~自己de王妃 提交于 2019-12-17 15:51:36
问题 at the moment i'm developing an OSGi based WebApp with Jetty and Equinox (see: http://wiki.eclipse.org/Jetty/Tutorial/EclipseRT-Jetty-Starter-Kit). Everything ist fine so far but i can't get access to some files/resources of my own bundle . The location/path is "configuration/data/config.csv" and "configuration/data/data.zip". I have tested everything: context.getBundleContext().getBundle().getEntry("config.csv"); context.getBundleContext().getBundle().getResource("config.csv"); this.getClass

Is it possible to Add/Remove/Change an embedded resource in .NET DLL?

*爱你&永不变心* 提交于 2019-12-17 15:47:06
问题 Is it possible to add/remove/change an embedded resource in a .NET DLL after it has been compiled? If so, how is this done, and are there any gotchas? Edit: I would like to do this manually, but eventually automatically through a script in the post-build event. 回答1: There's no way to do this in managed code . Once a resource has been embedded it becomes part of the assembly just like the compiled MSIL code is. However, you could do this manually , like suggested by Lucero, by disassembling

edit uri of existing resource using jena

╄→гoц情女王★ 提交于 2019-12-17 14:54:36
问题 I try to modify the uri of an existing resource of a ontology model. I thought of creating a new model, new resource (including the new desired uri) and duplicating the content of the old resource. By iterating and adding the statements doens't work properly. Is there another workaround? I'm working with jena in java and RDF/XML models. 回答1: As you've found resources are immutable. You can bring about the same effect using ResourceUtils.renameResource(resource, newName). This goes through

PHP allocate color without image resource

北慕城南 提交于 2019-12-17 14:54:35
问题 Can you allocate a color in PHP GD without an image resource? It should be possible because really an allocated color is a number, right? $im = imagecreatetruecolor(100, 100); $col = imagecolorallocate($im, 255, 0, 0); print $col."<br/>"; $col2 = imagecolorallocate($im, 255, 0, 0); print $col2."<br/>"; $im2 = imagecreatetruecolor(600, 100); $col3 = imagecolorallocate($im, 255, 0, 0); print $col3; This prints out: 16711680 16711680 16711680 I guess what the real question is how 255, 0, and 0