Changing Time Speed

2022.01.21 18:32 BackPuzzleheaded5498 Changing Time Speed

For my project, I am attempting to create blinking eyes of a face using paint graphics and a timer.
The "open eyes" face is supposed to be showing on the screen for 10000 milliseconds, then after that time, it's supposed to switch to the blink for 1000 milliseconds and repeat for now. The problem I'm having is that in my JPanel class, no matter what I change, the timer only sets itself to 10 seconds for each transition. I've tried setting the time-dependent on a variable (what my code below will show) along with other methods I'd assume would work. Such as Threads, waits, delays, etc. None to seemingly work. I'm assuming this is an easy fix, but cannot for the life of me figure it out. ANY help would be GREATLY appreciated. Thank you.



import javax.swing.*; import java.awt.*; import java.util.TimerTask; import java.util.Timer; public class MainPanel extends JPanel{ final int PANEL_WIDTH = 800; final int PANEL_HEIGHT = 700; Image backg; int time = 1; int speed; MainPanel() { Timer timer = new Timer(); backg = new ImageIcon("Grad1.jpg").getImage(); this.setPreferredSize(new Dimension(PANEL_WIDTH, PANEL_HEIGHT)); this.setBackground(Color.black); this.setLayout(null); TimerTask task = new TimerTask() { (@ symbol)Override public void run() { if (time == 1) { time--; } else if (time == 0) { time++; } } }; timer.scheduleAtFixedRate(task, 0, speed); } public void paint(Graphics g) { super.paint(g); // paint background repaint(); Graphics2D g2D = (Graphics2D) g; // how we get the graphics in g2D.drawImage(backg, 0, 0, null); g2D.setPaint(Color.white); if (time == 0) { this.repaint(); this.removeAll(); g2D.fillRect(220, 180, 50, 125); g2D.fillRect(520, 180, 50, 125); g2D.fillRect(270, 405, 250, 50); } if (time >= 1) { this.repaint(); this.removeAll(); g2D.fillRect(120, 300, 100, 5); // g2D.fillRect(520, 180, 50, 125); // g2D.fillRect(270, 405, 250, 50); } } }


Keep in mind this is my JPanel class. JFrame and the main method are separate classes with a minimal amount of requirements to make this function.
submitted by BackPuzzleheaded5498 to javahelp [link] [comments]


2022.01.21 18:32 maraganger PsiloSybil, a Crash Bandicoot inspired platformer.

PsiloSybil, a Crash Bandicoot inspired platformer. submitted by maraganger to IndieDev [link] [comments]


2022.01.21 18:32 Bi-elzebub Ok hear me out

Is Corlithe's grandma the bloody nine?
submitted by Bi-elzebub to TheFirstLaw [link] [comments]


2022.01.21 18:32 EliaBauer This project launch in 1 hours | Dont miss that | Im so bullish on this project | Launch pancakeswap soo fast

Polar Information
Here’s some information about the $POLAR Token.
Sale is on 3 days, 2022 23:00 UTC
We are hosting our Fairlaunch on PancakeSwap V2 (PUBLIC SALE)
Max Buy is 0.5 BNB at start.
Min Buy is 0.1 BNB at start.
Liquidity locked.
Sale Rate 1 BNB = 620.000.000.000
The official Pancakeswap launch time will be decided in a few days, we are working on growt our community.
The Tokenomics are:
50% Public Fairlaunch (Hosted on PANCAKESWAP)
2.5% NFT Creation (Details in our website)
40% Burn (To pump the Marketcap)
2.5% Team wallet (Locked & Vesting period untill 27th Dec)
5% Airdrop (To increase holders amount and awareness in social media)
📄 Here’s our Contract address : Find on tg
Is the DEV DOXXED?
Yes, dev is planning to reveal his identity and complete KYC.
Dev is from Europe and will be with you on voice chats everyday before the sale to answer all of your questions. Also, we will be having a strong moderation team, that will take care of the community by monitoring chat, hosting VCs etc.
What's the plan after launching?
Its all about MARKETING and getting Listed on CMC & CG and the DEXTOOLS trending. We got that sorted, expecting to get listed on the same day on CG & CMC or not more than 48 hours alongside with DEXTOOL trending.
What's after getting listed on CMC & CG?
After listing on CMC & CG, we will start developing NFT Collection, where holders will be able to participate as whitelisted contributers.
Speaking of marketing, we will still be getting awareness all across crypto space in social media by implementing influencers promotion, YouTube videos, Banner ads etc.
We are happy to announce that our smart contract will be created with the Pinksale Token aggregator 🌸 It means, that the contract is SAFU, Rug-proof and is safe to use and maintain.
For more information Tg: https://t.me/PolarCommunityBSC
submitted by EliaBauer to CryptoMoonShots [link] [comments]


2022.01.21 18:32 sushibabexx I am looking for a short term [Chat]

Answer this question as introduction: what do you do when you can't fall asleep?
submitted by sushibabexx to MeetPeople [link] [comments]


2022.01.21 18:32 trezzy1242 New to collecting... are these any good?

submitted by trezzy1242 to basketballcards [link] [comments]


2022.01.21 18:32 WkittySkittyLBoF Solana launching this week?

Wasn’t Solana supposed to launch this week on Celsius? I swear I remember hearing/reading this somewhere.
submitted by WkittySkittyLBoF to CelsiusNetwork [link] [comments]


2022.01.21 18:32 jonathangreek01 Homie straight up embodied the meme and wrote me a paragraph long response to my trolling.

Homie straight up embodied the meme and wrote me a paragraph long response to my trolling. submitted by jonathangreek01 to EnoughCommieSpam [link] [comments]


2022.01.21 18:32 sushibabexx I am looking for a short term [Chat]

Answer this question as introduction: what do you do when you can't fall asleep?
submitted by sushibabexx to MeetPeople [link] [comments]


2022.01.21 18:32 Stock-Manufacturer65 Found while cleaning my aunt’s garage. What is this?

Found while cleaning my aunt’s garage. What is this? submitted by Stock-Manufacturer65 to spiders [link] [comments]


2022.01.21 18:32 RuthRowe12 Vintage Evergrow EGC Coin Mission To The Moon Crypto Token Cryptocurrency Wallet

Vintage Evergrow EGC Coin Mission To The Moon Crypto Token Cryptocurrency Wallet submitted by RuthRowe12 to evergrowcoin [link] [comments]


2022.01.21 18:32 Char_97 Anyone else “bored” of gaming?

I’ve been a gamer practically all my life and currently I have a PS5 that I’ve had about 7 months and a XSS (for Game Pass) that I’ve had for just under a month but I kinda feel like I’m becoming bored of gaming.
I can be really in the mood to game so I’ll fire up whatever console I feel like playing and might take me a while to figure out what I want to play then after like 20-30 minutes I feel bored/not in the mood to play anything so I’ll come off. I get right in the mood but for how “in the mood” I am I get “bored” too quickly.
submitted by Char_97 to gaming [link] [comments]


2022.01.21 18:32 DamnInteresting Tahiti’s Newly Discovered Coral Reef Is an Absolute Masterpiece

Tahiti’s Newly Discovered Coral Reef Is an Absolute Masterpiece submitted by DamnInteresting to DamnInteresting [link] [comments]


2022.01.21 18:32 ClydeH96 SX.CN DD on St. Georges Eco Mine!

Some great DD on St. Georges Eco Mine!
https://www.reddit.com/batterygang/comments/s8vxis/an_introductory_macro_view_and_a_breakdown_of_the/?utm_medium=android_app&utm_source=share
submitted by ClydeH96 to CanadianInvestor [link] [comments]


2022.01.21 18:32 politicly1 Treason Trump Says Georgia Election Call Was More "Perfect" Than His Ukraine One

Treason Trump Says Georgia Election Call Was More submitted by politicly1 to politicly [link] [comments]


2022.01.21 18:32 ContentForager2 I built my own lego version of Carcassonne! (/r/boardgames)

submitted by ContentForager2 to mistyfront [link] [comments]


2022.01.21 18:32 ThePaleGriffon look at that, i found my deadpool figure that my dad was able to get back in 2016 from the set of deadpool, he was even able to get a cup and two posters, one signed by the director, i would brag about it to everyone that my dad got to work on deadpool and even got to talk to him in the break room👍

look at that, i found my deadpool figure that my dad was able to get back in 2016 from the set of deadpool, he was even able to get a cup and two posters, one signed by the director, i would brag about it to everyone that my dad got to work on deadpool and even got to talk to him in the break room👍 submitted by ThePaleGriffon to ActionFigures [link] [comments]


2022.01.21 18:32 cowboyblus told you'd like this over here. heavily stoned sandwich made with ciabatta (stale) fried in olive oil, tomato, cheese, jalapeño relish, and aioli. tasted incredible.

told you'd like this over here. heavily stoned sandwich made with ciabatta (stale) fried in olive oil, tomato, cheese, jalapeño relish, and aioli. tasted incredible. submitted by cowboyblus to TheHighChef [link] [comments]


2022.01.21 18:32 Cloverspine Forget I even asked

Forget I even asked submitted by Cloverspine to PhilosophyMemes [link] [comments]


2022.01.21 18:32 KillHonger1 Just Finished TDR for the first time: Immediate Thoughts (Spoilers Marked)

What a interesting book. Weirdly I feel that very little happened in this book compared to the first two books but the character development of Perrin and Mat have me over the moon.

Quick Thoughts
Throughout everything that was unfolding in Tyr I kept thinking to myself "I wish I could hook these fools up with some walkie talkies or something" lol. If only they could talk to each other when not directly face to face so much time could be saved.
I was really happy the story let us breathe from Rand's storyline and focused on Perrin/Mat/The Accepted 3
- Perrin's slow but eventual ability to accept [TDR] himself: His Wolf Dreams, Faile, His role Ta'veren
- I am slowly coming around to Mat (He is hilarious and bold) but still dislike his slipperiness and can't wait till he has some self revelation like Perrin
- Moraine still has a long way to go when it comes to her people skills but glad she is realizing it's a flaw to underestimate the other Emond's Fielders.
- Why do most of the female characters have to be dicks? Not a whole lot of empathy being displayed by
- Moraine - I don't mind that she is close to the vest but even in Perrin's lowest moment [TDR]Faile getting trapped her demeanor really comes off as petty annoyance shows a complete lack of empathy
- Nynaeve - I mean not much needs to be said here, she sucks
- Elayne/Egweyne - They aren't as bad as Nynaeve but they definitely are yapping up the Aes Sedai self importance attitudes. The way they treated [TDR] Mat after he saves them was pathetic
- Elaida - Very Unpleasant
- Black Ajah - nasty business there sheesh
- Now that I typed that all out perhaps its just an Aes Sedai (minus Verin, shes the best) problem and not a women problem
- Could not have been happier that we got a deeper dive into both [TDR] Aeil culture and [TDR] the Forsaken
Favorite minor parts
- Perrin getting to be a black smith if even for a short period
- Mat's total lack of understanding of fireworks (yes I know not many people do know how they work but his inner dialogue about them was hilarious)
Couple of memorable Quotes
Most Emotional
[TDR] " I swear I will only call you Faile, ever again" and "Faile - My Falcon" - Perrin
Funniest
"Can you count so high, you fat fool?" - Mat to the guard at the Caemlyn palace

Can't wait to pick up TSR tomorrow and get back to it
submitted by KillHonger1 to WoT [link] [comments]


2022.01.21 18:32 backdoor_nobaby [POSITIVE] for /u/1WontDoIt [seller]

This seller is an Ace! Great communication and without a doubt the best packaging I’ve ever received from a seller on here or a commercial business.

Have no worries friend, you’ll be happy Buying from u/1WontDoIt
submitted by backdoor_nobaby to PMsFeedback [link] [comments]


2022.01.21 18:32 Neat-Bend-4267 Does Zenith have a official discord?

submitted by Neat-Bend-4267 to ZenithMMO [link] [comments]


2022.01.21 18:32 legos45 [Amazon] Razer Blade 15 Advanced Laptop: i7-11800H, RTX 3080 Max 105W, 32 GB RAM, 1 TB SSD, 1080p 15.6″ 360Hz IPS Display for $2,699.99 after 13% off

[Amazon] Razer Blade 15 Advanced Laptop: i7-11800H, RTX 3080 Max 105W, 32 GB RAM, 1 TB SSD, 1080p 15.6″ 360Hz IPS Display for $2,699.99 after 13% off submitted by legos45 to LaptopDeals [link] [comments]


2022.01.21 18:32 RyanF612 Chrome Update inserts/Parallels FT. PC Mets, RCs, 1sts

Chrome Update inserts/Parallels FT. PC Mets, RCs, 1sts submitted by RyanF612 to baseballcards [link] [comments]


2022.01.21 18:32 Bmc_Studio Just got this bad boy from Brazil!

Just got this bad boy from Brazil! submitted by Bmc_Studio to SEGAGENESIS [link] [comments]


http://gazetapobeda.ru