You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

1

Saturday, October 22nd 2011, 8:52pm

animated gif - how to?

Hey there,
did anyone ever succeed in showing an animated .gif in a Label or other usercontrol?
Does anyone have an idea how to do that?

Dani




Edit:
I just found this post stating that a PictureBox does what I am looking for. My PictureBox does not play the animated .gif above! Is there any special format/ framerate, etc. required?

Edit2:
Hey, and don't tell me to use the progressbar!! :D

This post has been edited 2 times, last edit by "Dani" (Oct 22nd 2011, 9:24pm)


theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

2

Sunday, October 23rd 2011, 3:24am

Ypu need to use a Java-way in this case, too.

If your gif is called "loading.gif", then load it to your resources and create a Usercontrol with

Jabaco Source

1
2
3
4
5
6
7
Public Sub Usercontrol_Initialize()
   Dim myIcon As javax#swing#ImageIcon
   myIcon = New javax#swing#ImageIcon(getClass.getResource("res/loading.gif"))
   Dim myPic As javax#swing#JLabel = New javax#swing#JLabel(myIcon)
   myPic.setBounds(0,0,105,16)
   Me.add(myPic)
End Sub


In the uploaded file I have already done it.
theuserbl has attached the following file:
  • AnimatedGif.zip (5.04 kB - 407 times downloaded - latest: Mar 30th 2024, 3:40am)

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

3

Sunday, October 23rd 2011, 9:43am

Thanks again theuserbl,

very nice example. Opened my eyes about a couple of other issues as well!!
It is not that easy to allways come up with the according java syntax.
Still I am glad Jabaco is this flexible.

Um den Bogen noch etwas weiter zu spannen:

How would I add an image (not animated) to a JBgrid cell?


Dani

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

4

Sunday, October 23rd 2011, 2:02pm

Uploaded demonstrating file
Hope it helps.

Greatings
theuserbl
theuserbl has attached the following file:
  • PicInJbGrid.zip (6.18 kB - 397 times downloaded - latest: Yesterday, 12:32pm)

Dani

Intermediate

  • "Dani" started this thread

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

5

Tuesday, October 25th 2011, 10:30am

Thank You,

I experimented a little bit with this. Thanks to you inspiration a came up with a direct way.
SamplePng needs to be present in your '/Res' directory.

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
Public Sub Form_Load()
   JBGrid1.Cols = 2
   JBGrid1.Rows = 2
 
   JBGrid1.Header(0) = "Pictures"

   'needs to be adressed
   JBGrid1.TextMatrix(0, 0) = ""
   JBGrid1.DataMatrix(0,0).Icon = SamplePng
   
   JBGrid1.Parent.setRowHeight(80)

End Sub


I was also looking at:

Jabaco Source

1
2
JBGrid1.Editable = jbEditOnClick
JBGrid1.ComboList = "Hallo"


but I can not add more than one item to the cbo list and it appears in every cell of the JBGrid1.

Other issues with the JBGrid would be invoking a checkbox, the JBGrid1.CellButton and maybe a colSortIndicator in the header (independent from autosort!). I did not look at those yet though.


Dani

theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

6

Wednesday, October 26th 2011, 6:07pm

but I can not add more than one item to the cbo list and it appears in every cell of the JBGrid1.
Haven't looked particularly at it.

But possibly this side could help you:
[ http://www.jabaco.org/wiki/ComboBox ]

Greatings
theuserbl

swissmade

Beginner

  • "swissmade" is male

Posts: 46

Date of registration: Aug 4th 2011

Location: The Netherlands

Occupation: Old Fasion Programmer

Hobbies: Play Music with my Bass

  • Send private message

7

Saturday, October 29th 2011, 7:55pm

Nice Sample,

Thanks 8)
Uploaded demonstrating file
Hope it helps.

Greatings
theuserbl

Rate this thread
WoltLab Burning Board