#Whats wrong the Image doesent appear?

1 messages ยท Page 1 of 1 (latest)

knotty walrus
random lotusBOT
#

โŒ› This post has been reserved for your question.

Hey @knotty walrus! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

pliant cedar
#

gotta put the jlabel in a variable and at least do setVisible(true), maybe even give it a size

knotty walrus
#

New Code still not working

pliant cedar
#

maybe first setvisible, then add, not sure

knotty walrus
#

no also not working

pliant cedar
#

remove the getcontentpane

#

like just frame.add

knotty walrus
#

still not

pliant cedar
#

repaint at the end?

knotty walrus
#

whats that?

pliant cedar
#

try frame.repaint() at the end

knotty walrus
#

no also not

pliant cedar
#

then im out of ideas

#

sry

knotty walrus
#

np thanks

dusky spruce
#

Show project structure

knotty walrus
#

like this?

dusky spruce
#

Yes

#

Can you create another directory called e.g. resources

knotty walrus
#

Could it be the picture?

dusky spruce
#

Then right click and mark as resources dir

#

Or better still use Maven

knotty walrus
dusky spruce
#

Folder

knotty walrus
#

I have one: Bilder

#

And then?

dusky spruce
#

Build path

#

What's under there

#

I'm not familiar with eclipse

knotty walrus
dusky spruce
#

Use as source folder...but might not be right

#

Move the pngs into there

#

Rebuild project (not sure how in eclipse)

#

Project > rebuild project apparently

knotty walrus
dusky spruce
#

Click monopoly

#

On left

#

Click project

#

Click build all

knotty walrus
#

There is no build all

dusky spruce
#

Ok whatever close this send project structure pic again

dusky spruce
#

Run again see what happens

knotty walrus
#

nothing happens

dusky spruce
#

You mean no image?

#

If yes send project structure

knotty walrus
#

yes

dusky spruce
#

Remove Bilder

#

Keep slash

knotty walrus
#

If I drag and drop the picture this appears

dusky spruce
#

Why dragging and dropping anything

#

Where did Bilder dir go

#

Please put back how it was

knotty walrus
dusky spruce
#

Sorry I meant remove Bilder from the string lol

#

But keep the slash

knotty walrus
#

yeah still nothing

dusky spruce
#

Show structure and code

knotty walrus
dusky spruce
#

No slash

#

Put slash back

#

"/Hintergrund.png"

knotty walrus
dusky spruce
#

So getresource returns a URL right

knotty walrus
#

yes

dusky spruce
#

Can you do getresourceasstream and readallbytes on that

#

Forget the jlabel shit for now

#

Let's see if can get the bytes out to see if program can reach the file

dusky spruce
knotty walrus
#

on recource 1?

dusky spruce
#

On hintergrund

#

System.out.println(gc.gcl.gras("/skskkd.png").readallbytes().length)

knotty walrus
#

but with hintergrund in the string of course

dusky spruce
#

I meant getClass.getclassloader.getresourceasstream lol

#

I was shortening because went to mobile

#

Just do same thing you're doing above but print it out to see if bytes being read

knotty walrus
#

Can you write it I dont understand?

#

๐Ÿ˜Ÿ

#

/close