Use Java to display an Image depending on a Websites Status?

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 3307 Views - Last Post: 07 August 2012 - 11:18 PM

#1 EmiT FliX  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 05-August 12

Use Java to display an Image depending on a Websites Status?

Posted 05 August 2012 - 07:36 PM

Hey,

I'm having trouble with getting this image to change depending on a website.

Pretty much I'm setting up a live stream status for my website, I have 2 images (off, on) It is set to Off at default and I want it to change once I start my livestream. I've searched a good 4 hours over the past 2 days and cannot find anything.

Attached is an image that shows the design.
Is This A Good Question/Topic? 0
  • +

Replies To: Use Java to display an Image depending on a Websites Status?

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Use Java to display an Image depending on a Websites Status?

Posted 05 August 2012 - 07:55 PM

Not really sure what you mean, and there is nothing attached.
Why would your website not being available ? Server down ?
Was This Post Helpful? 0
  • +
  • -

#3 EmiT FliX  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 05-August 12

Re: Use Java to display an Image depending on a Websites Status?

Posted 05 August 2012 - 08:19 PM

View Postpbl, on 05 August 2012 - 07:55 PM, said:

Not really sure what you mean, and there is nothing attached.
Why would your website not being available ? Server down ?


WEbsite isn't online becuase I'm in the designing of it, I'm just needing to get this live stream done

Now what I need to do is the following

Have an image that says "off" change to another image that has "on" once I have started a livestream

What I mean by this is:
Once the streaming starts it uses a specific address each time and I want my livestream status to change depending on that link being opened.

If you need more information let me know.
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Use Java to display an Image depending on a Websites Status?

Posted 05 August 2012 - 08:27 PM

If you try to establish a URLConnection and it fails, the site is not up and running
Was This Post Helpful? 0
  • +
  • -

#5 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2639
  • View blog
  • Posts: 11,153
  • Joined: 20-September 08

Re: Use Java to display an Image depending on a Websites Status?

Posted 06 August 2012 - 02:18 AM

Surely you should be displaying such an image on the website itself?
Was This Post Helpful? 0
  • +
  • -

#6 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Use Java to display an Image depending on a Websites Status?

Posted 06 August 2012 - 04:36 AM

lol)))
Was This Post Helpful? 0
  • +
  • -

#7 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2639
  • View blog
  • Posts: 11,153
  • Joined: 20-September 08

Re: Use Java to display an Image depending on a Websites Status?

Posted 06 August 2012 - 04:38 AM

(I'm assuming that the bit that's 'down' is just the streaming functionality)
Was This Post Helpful? 0
  • +
  • -

#8 EmiT FliX  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 05-August 12

Re: Use Java to display an Image depending on a Websites Status?

Posted 06 August 2012 - 04:39 PM

Alright, I may have confused you all. The website works perfectly, I am just trying to have an image change automatically when I start my live stream.

Here's a simple Diagram of what I want.




Website---->offbutton

View PostEmiT FliX, on 06 August 2012 - 04:35 PM, said:

Alright, I may have confused you all. The website works perfectly, I am just trying to have an image change automatically when I start my live stream.

Here's a simple Diagram of what I want.

Livestream Status
|
|
-------------------
| |
| |
Website---->offbutton On Button

[quote name='EmiT FliX' date='06 August 2012 - 04:37 PM' timestamp='1344296275' post='1679716']
Alright, I may have confused you all. The website works perfectly, I am just trying to have an image change automatically when I start my live stream.

Here's a simple Diagram of what I want.




Website---->offbutton

[quote name='EmiT FliX' date='06 August 2012 - 04:35 PM' timestamp='1344296157' post='1679716']
Alright, I may have confused you all. The website works perfectly, I am just trying to have an image change automatically when I start my live stream.

Here's a simple Diagram of what I want.




WEbsite->offbutton->Livestreamstatus->Onbutton
Was This Post Helpful? 0
  • +
  • -

#9 skymonkier  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 107
  • Joined: 14-July 12

Re: Use Java to display an Image depending on a Websites Status?

Posted 06 August 2012 - 04:43 PM

While I am doubtful I'm being helpful here, I would go about this is a more rounda-bout method. If it were me, I'd take the easier path of using Java(Script?) to use a boolean to tell if you're livestreaming or not. Based on this boolean, you could have PHP change the image to the desired on/off state. This could make the entire thing easier to learn and utilize.

My own idea of how this could work. :P

Cheers!
skymonkier

P.S. Not sure if you can really integrate Java(Script?) and PHP like that.

This post has been edited by skymonkier: 06 August 2012 - 04:44 PM

Was This Post Helpful? 0
  • +
  • -

#10 EmiT FliX  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 05-August 12

Re: Use Java to display an Image depending on a Websites Status?

Posted 06 August 2012 - 04:46 PM

View Postskymonkier, on 06 August 2012 - 04:43 PM, said:

While I am doubtful I'm being helpful here, I would go about this is a more rounda-bout method. If it were me, I'd take the easier path of using Java(Script?) to use a boolean to tell if you're livestreaming or not. Based on this boolean, you could have PHP change the image to the desired on/off state. This could make the entire thing easier to learn and utilize.

My own idea of how this could work. :P

Cheers!
skymonkier

P.S. Not sure if you can really integrate Java(Script?) and PHP like that.

Thanks, though I had no idea if this was possible in Javascript I was fine with changing the language, so, I may try this idea and see what I come out with, I'm fairly new to the whole livestreaming and PHP thing (basically I can make a simple login site and database), so if you are able to help me anymore it would be much appreciated, again Thanks.
Was This Post Helpful? 0
  • +
  • -

#11 skymonkier  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 107
  • Joined: 14-July 12

Re: Use Java to display an Image depending on a Websites Status?

Posted 06 August 2012 - 04:49 PM

View PostEmiT FliX, on 06 August 2012 - 04:46 PM, said:

Thanks, though I had no idea if this was possible in Javascript I was fine with changing the language, so, I may try this idea and see what I come out with, I'm fairly new to the whole livestreaming and PHP thing (basically I can make a simple login site and database), so if you are able to help me anymore it would be much appreciated, again Thanks.


No problem. Sadly, I'm unable to help when it comes to coding, as I can only do login and register, as well. I just think of ways to accomplish things. Let me know how it turns out! :]
Was This Post Helpful? 0
  • +
  • -

#12 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2639
  • View blog
  • Posts: 11,153
  • Joined: 20-September 08

Re: Use Java to display an Image depending on a Websites Status?

Posted 07 August 2012 - 02:45 AM

The streaming is server-side functionality so any buttons you show would be normally done server-side when the streaming had started
Was This Post Helpful? 0
  • +
  • -

#13 EmiT FliX  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 05-August 12

Re: Use Java to display an Image depending on a Websites Status?

Posted 07 August 2012 - 02:48 AM

View Postg00se, on 07 August 2012 - 02:45 AM, said:

The streaming is server-side functionality so any buttons you show would be normally done server-side when the streaming had started

It's not my own stream, I'm using twitch.tv to live stream.
Was This Post Helpful? 0
  • +
  • -

#14 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2639
  • View blog
  • Posts: 11,153
  • Joined: 20-September 08

Re: Use Java to display an Image depending on a Websites Status?

Posted 07 August 2012 - 03:16 AM

Ah OK. That's somewhat different. In that case, Javascript might be a better idea. Please move this with mods assistance, to the Javascript area
Was This Post Helpful? 0
  • +
  • -

#15 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10364
  • View blog
  • Posts: 38,373
  • Joined: 27-December 08

Re: Use Java to display an Image depending on a Websites Status?

Posted 07 August 2012 - 09:15 AM

I'll move this to javascript.

g00se- you should have permissions to move topics as well. If you don't, please shoot me a PM so I can fix this.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2