Questions tagged [getresource]

283 questions
0
votes
1 answer

Modx: getResources - sort by id ascending/descending?

I want to try and order my resources by ID in ascending order. Annoyingly, the documentation doesn't mention this though I am sure its possible. Currently I have: &sortby=`id` Would anyone know the correct way to order by ascending or…
MeltingDog
  • 14,310
  • 43
  • 165
  • 295
0
votes
2 answers

How can i get .txt file in my jar?

I want to say I search a lot even google and stackoverflow. There are many topics about this but I dont find exactly what I need. My problem is : I want to define file which is in my own package folder.File's format is .txt. And file is in …
user1716182
  • 51
  • 1
  • 9
0
votes
2 answers

Modx getResources: way to get resources between X and X?

I was wondering if anyone knew a way to retrieve, say the first 5 (eg: 1 -5) resources of a parent with one getResource line, the retrieve the next 5 (6 - 10) with another getResources line? Kind of like pagination. I was unable to find something to…
MeltingDog
  • 14,310
  • 43
  • 165
  • 295
0
votes
1 answer

ModX getResources template not receiving TVs

I have the following getResources line: [[!getResources? &parents=`5` &tpl=`projlink` ]] Then in the chunk I am using as a template (projlink) I have:
[[+pagetitle]]
[[+tv.projinfo]]
Now the…
MeltingDog
  • 14,310
  • 43
  • 165
  • 295
0
votes
2 answers

Modx Revo: getResources not displaying data

I have a resource called 'My Projects' with the following getResources syntax: [[!getResources? &parents=`5` &tpl=`protmp` ]] The chunk, 'protmp', I am using as a template is simple:
[[*pagetitle]]
Resource ID 5…
MeltingDog
  • 14,310
  • 43
  • 165
  • 295
0
votes
2 answers

The method setImageDrawable(getResources().getDrawable(XX)) doesn't display the good image

i succeed in using this code in a new project, but, when copying it in my actual code, the image displayed is not the good one everything is well made (image is in the folder drawable, every data well declared, ...) image begin with "phoXX", where…
Ronandroid
  • 53
  • 1
  • 9
0
votes
1 answer

Getting jLabel image url in Java

I'll make it short. I've put a jLbl_show and in a if condition I've set an image for it. if(int c==1){ jLbl_show0.setIcon(new ImageIcon(getClass().getResource("/img/wrong.png"))); } else{ jLbl_show0.setIcon(new…
Harindra Singh
  • 371
  • 2
  • 6
  • 17
0
votes
2 answers

Move 3 rectangles up in their X but keep order of rectangles

I have 3 rectangles being rendered here. Let's say i wanted to move them all above the line yet keep their order, how would i go about that? I tried subtracting the Y and height rather than adding the Y it but as expected, the lower rectangle goes…
Nicolas Martel
  • 1,641
  • 3
  • 19
  • 34
0
votes
2 answers

ModX Revo: Display one resource within another

I want to display the contents of one resource within another. I think this is possible with getResources but I cannot get it working for me. I have: [[getResources &parents=`-1` $resources =`16`]] but nothing displays. I have made sure all…
MeltingDog
  • 14,310
  • 43
  • 165
  • 295
0
votes
1 answer

ModX: GetResource showing Child instead of resource number

Heres a weird ModX issue: I have the following code in my template: [[!getResources? &resources=`15` &includeContent=`1` &tpl=`slider-banner`]] Resource 15 has an image in it I used as the banner. This works fine on each of my pages bar one where,…
MeltingDog
  • 14,310
  • 43
  • 165
  • 295
0
votes
3 answers

Cannot access resource by using the getResources() method

I have the following project-tree: I can access the 290.gif file in the path: Java GUI/src/dk/resources/290.gif by using the following command: this.getClass().getResource("/dk/resources/290.gif") But I can't access the 290.gif file in the path:…
Birdman
  • 5,244
  • 11
  • 44
  • 65
0
votes
0 answers

How to use getResource() to load an image and some html files?

In eclipse I made a project inside the src folder. I made a package called res inside it I put all of the html/gif files. Can someone please give me the line of code that would change button with the new location? setIcon(new…
ribarcheto94
  • 436
  • 11
  • 25
0
votes
1 answer

why does getResource give different result?

Bellow is my code, when i run these code in IDE it works well, but when i run in dos command it gives me an error of NullPointException. Please give me a hand. thanks! //first get the classLoader ClassLoader classLoader =…
user1436285
  • 291
  • 1
  • 3
  • 4
0
votes
2 answers

Getting File from .jar using .getResource()

I'm trying to acces a File inside the .jar. In Netbeans, this: System.out.println(new File(this.getClass().getResource("Image.jpg").getFile()).exists()); Prints out: true After building however, it prints false. The file is definitely in the .jar,…
Mark
  • 3
  • 3
0
votes
2 answers

Cant Read Resource

I am trying to read a *.class resource from a package. I am using the following code to achieve this... URL path = SomeClass.class.getResource("/source/someClass.class"); When I run this code, I end up with path = null;. However, if I use the same…
Anton Putov
  • 1,951
  • 8
  • 34
  • 62
1 2 3
18
19