//docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html#text //--------------------------------------------------------------- public class Main { public static void main(String[] args) {
new MyFrame(); } } //--------------------------------------------------------------- import java.awt.*; import java.text.*; import java.util.*; import javax.swing.*; public class MyFrame extends JFrame{
I hope you can read this to cheer you up. I've watched a lot of your videos and it help me a lot. I saved some of them on my JAVA playlist to be accessed quickly when I forgot something, It really helped me a lot. Then I've realized that I didn't subscribed to you. I just did now and I just want to say thank you so much, It helped me a lot. Hope you make more videos that will help someone in the future.
The setTime(); method actually works even without the Thread.sleep(1000); as long as the code is inside the while loop. The timeFormat will move each second for me. Anyway. Big thanks for this!
your video was very helpful for me Respect Thank you It really helped me a lot. Then I've realized that I didn't subscribed to you. I just did now and I just want to say thank you so much, It helped me a lot. Hope you make more videos that will help someone in the future.
Thank you so much ,I watched two other videos on this program before this , but can't able to execute and understand the program .But this one was so easy to understand and I successfully completed this .Thank you once again.
Hey, bro. You are amzing. Your every video turorial are so good. You make everything easy. You are a great teacher. How did you master such great teaching strategy? Could you make a separate tutorial on How to teach well?" I'd very appreciate it.
Thanks for this. I've been trying to find how I can make a program simulate real-time but couldnt find anything until "java clock" landed me this video (and a bunch of showcases that explained nothing). I want to practise some things like classes and methods by making a tournament (selection, preliminaries, pool phase, knock-out phase and several different events will help me get a grasp on these concepts i think, in a fun way). but i wanted to do it with time limits per game like in real life, where during the game things can happen. for example football or beach volleyball etc, but I cant implement that without knowing how to process real time in java. ok gonna watch this now :) EDIT: I already see something I didn't know was possible a few seconds in. You just put new MyFrame(); but I thought you always have to name your instances. MyFrame blabla equals new MyFrame, etc.
these vids are super helpfull thanks alot of and for the lasy people like me besides clicking on the src file and then clicking on file and then new class click all these: alt - shift - n and you will need to click on class
Great vid!! One question though that came up about extendability, how do you apply an alarm-setting to time-applications using the SimpleDateFormat? (2)
in 2:31, i run test and reslut say "Error occurred during initialization of boot layer java.lang.module.FindException: Error reading module: C:\Users\cusie\eclipse-workspace\Clock\bin Caused by: java.lang.module.InvalidModuleDescriptorException: Main.class found in top-level directory (unnamed package not allowed in module" can u pls help me
What I would like to see, is a separate file, a library of sorts, that can be called in other files. so, I can have several windows, that will call this method, to display across different windows
This is like my second vid on coding i went from nothing to making this by following the vid and struggling for like 2-3 hours tryna find my mistakes...Was amazing when I found what I did wrong though :)
This help me a lot , but i got some problems here, when i use this clock.java for 2nd class then i called it on my main.java class the clock.java won't show anything kinda stuck in loop
I have a question, please! I tried to make a frame that has two buttons (Stopwatch & Clock), when clicked would produce a new window with each of their respective programs. When I click the button of the stopwatch, it works just fine, but the clock doesn't . The window opens, but it's empty. What's more is that I can't exit out of it by clicking the x button. It's as if the Default operation was DO NOTHING. I tried to delete the while loop and everything in it by passing it as a comment. The clock frame closes. May anyone please tell me why this is so? AND THANK YOU ALWAYS, BROO!
//docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html#text
//---------------------------------------------------------------
public class Main {
public static void main(String[] args) {
new MyFrame();
}
}
//---------------------------------------------------------------
import java.awt.*;
import java.text.*;
import java.util.*;
import javax.swing.*;
public class MyFrame extends JFrame{
Calendar calendar;
SimpleDateFormat timeFormat;
SimpleDateFormat dayFormat;
SimpleDateFormat dateFormat;
JLabel timeLabel;
JLabel dayLabel;
JLabel dateLabel;
String time;
String day;
String date;
MyFrame(){
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("My Clock Program");
this.setLayout(new FlowLayout());
this.setSize(350,200);
this.setResizable(false);
timeFormat = new SimpleDateFormat("hh:mm:ss a");
dayFormat = new SimpleDateFormat("EEEE");
dateFormat = new SimpleDateFormat("MMMMM dd, yyyy");
timeLabel = new JLabel();
timeLabel.setFont(new Font("Verdana",Font.PLAIN,50));
timeLabel.setForeground(new Color(0x00FF00));
timeLabel.setBackground(Color.black);
timeLabel.setOpaque(true);
dayLabel = new JLabel();
dayLabel.setFont(new Font("Ink Free",Font.PLAIN,35));
dateLabel = new JLabel();
dateLabel.setFont(new Font("Ink Free",Font.PLAIN,25));
this.add(timeLabel);
this.add(dayLabel);
this.add(dateLabel);
this.setVisible(true);
setTime();
}
public void setTime() {
while(true) {
time = timeFormat.format(Calendar.getInstance().getTime());
timeLabel.setText(time);
day = dayFormat.format(Calendar.getInstance().getTime());
dayLabel.setText(day);
date = dateFormat.format(Calendar.getInstance().getTime());
dateLabel.setText(date);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
//---------------------------------------------------------------
@Prashik Menka Valmik Indase eclipse bro
Please make a video about clock timer in javafx
Practicing...
public class Main
{
public static void main(String[] args) {
new MyFrame();
}
}
*******************
import java.text.*;
import java.time.*;
import java.awt.*;
import java.util.*;
import javax.swing.*;
public class MyFrame extends JFrame
{
Calendar Calendar;
SimpleDateFormat timeFormat;
SimpleDateFormat dayFormat;
SimpleDateFormat dateFormat;
JLabel timeLabel;
JLabel dayLabel;
JLabel dateLabel;
String time;
String day;
String date;
MyFrame ()
{
this.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
this.setTitle ("Clock App");
this.setLayout (new FlowLayout ());
this.setSize (400, 280);
this.setResizable (false);
timeFormat = new SimpleDateFormat ("hh:mm:ss a");
dayFormat = new SimpleDateFormat ("EEEE");
dateFormat = new SimpleDateFormat ("MMMMM dd, yyyy");
timeLabel = new JLabel ();
timeLabel.setFont (new Font ("Sans Seriff", Font.PLAIN, 18));
timeLabel.setForeground (Color.red);
timeLabel.setBackground (Color.black);
timeLabel.setOpaque (true);
dayLabel = new JLabel ();
dayLabel.setFont (new Font ("Helvetica", Font.PLAIN, 20));
dateLabel = new JLabel ();
dateLabel.setFont (new Font ("Helvetica", Font.PLAIN, 20));
this.add (timeLabel);
this.add (dayLabel);
this.add (dateLabel);
this.setVisible (true);
setTime ();
}
public void setTime ()
{
while (true)
{
time = timeFormat.format (Calendar.getInstance ().getTime ());
timeLabel.setText (time);
day = dayFormat.format (Calendar.getInstance ().getTime ());
dayLabel.setText (day);
date = dateFormat.format (Calendar.getInstance ().getTime ());
dateLabel.setText (date);
try
{
Thread.sleep (1000);
}
catch (InterruptedException e)
{
e.printStackTrace ();
}
}
}
}
I hope you can read this to cheer you up. I've watched a lot of your videos and it help me a lot. I saved some of them on my JAVA playlist to be accessed quickly when I forgot something, It really helped me a lot. Then I've realized that I didn't subscribed to you. I just did now and I just want to say thank you so much, It helped me a lot. Hope you make more videos that will help someone in the future.
Man...you know exactly what i need everytime i search for help and i found your videos, very helpful
Respect 💪
Support from fans. Please keep doing this kind of tutorial!
This channel is the reason I'm still trying to learn. thanks
You can do it Jordan!
@@BroCodez I made a video creating my first GUI and I used a lot of what you taught me and created a counter GUI. I hope your channel blows up.
The setTime(); method actually works even without the Thread.sleep(1000); as long as the code is inside the while loop. The timeFormat will move each second for me.
Anyway. Big thanks for this!
sometimes i click on a video that i know im not equipped for, but i just want to see what to expect in the future! and it excites me
Thanks bro this chennal is very helpful for students and I am from INDIA
This tutorial is amazing this whole channel is! I am planning to do your 7 hour full java course
You help me coding my first Java apps. Thank you very much.
Awesome bro I'm watching your videos regularly. great work. thanks a lot for the content.
thanks for watching!
This dude is really out here coding at 7 am on a Sunday, ha ha. Props.
well explained it is easy to understand.
Lovely 😍
This video is really helpfull bro. Subscribed 🤩
Good video for developer
a good java video with good English is a GEM!thxx
your video was very helpful for me Respect Thank you It really helped me a lot. Then I've realized that I didn't subscribed to you. I just did now and I just want to say thank you so much, It helped me a lot. Hope you make more videos that will help someone in the future.
excellent🤩
Thank you Bro Code. You help me so much. I really appreciate what you have done here.
Thank you so much ,I watched two other videos on this program before this , but can't able to execute and understand the program .But this one was so easy to understand and I successfully completed this .Thank you once again.
Awesome bro
Brooo, you're good at explaining, amazing........
I'm complete this code..thank you so much for your help
cool
Thanks for this great effort sir
Thanks for the tutorial.
Good job
Niceeee
🤜🤜🤜
Nice
Hey, bro. You are amzing. Your every video turorial are so good. You make everything easy. You are a great teacher. How did you master such great teaching strategy? Could you make a separate tutorial on How to teach well?"
I'd very appreciate it.
Awesome vid bro
thanks Dbest
//Great video :)
Thanks Bro for the video. Great job!
Thank you Bro Code i am learning Java from your channel
very helpful thank you
Thanks for this. I've been trying to find how I can make a program simulate real-time but couldnt find anything until "java clock" landed me this video (and a bunch of showcases that explained nothing).
I want to practise some things like classes and methods by making a tournament (selection, preliminaries, pool phase, knock-out phase and several different events will help me get a grasp on these concepts i think, in a fun way). but i wanted to do it with time limits per game like in real life, where during the game things can happen. for example football or beach volleyball etc, but I cant implement that without knowing how to process real time in java.
ok gonna watch this now :)
EDIT: I already see something I didn't know was possible a few seconds in. You just put new MyFrame(); but I thought you always have to name your instances. MyFrame blabla equals new MyFrame, etc.
can u specify the theme for ur editor , its so well colored !!
make alarm clokc , timer too , sir thanks
understandable, thanks
Good bro
Clear and useful as usual. Thanks!
Great vid!! One question though that came up about extendability, how do you apply an alarm-setting to time-applications using the SimpleDateFormat?
I have the same question you know
It's a pure art
Thank you sir
Good
how do I center the window when running the program (starts in the center of the screen)
You are awesome. 👏
👍
Bro thanks 👍👍❤
Thanks bro... It just what i neer to create a planner app for practice... greetings 15/01/2023
these vids are super helpfull thanks alot
of and for the lasy people like me besides clicking on the src file and then clicking on file and then new class click all these: alt - shift - n and you will need to click on class
Thank you... Bro code..... Love Bangladesh
thanks for everything.
🤗
Great vid!! One question though that came up about extendability, how do you apply an alarm-setting to time-applications using the SimpleDateFormat? (2)
bro dudeu just awesome just sub ur channel today bring more java content
How do I set Border color, width of the Frame ?
Thanks ✨✨
Thank you very much.
Thanks man this was soo helpful!
Very nice video, thank you very much. Can this app be opened outside of Eclipse?
thanks for this videos Bro! ;-)
thank you so much bro 🥰🥰
amazing as usual
Thankyou so much!! you help me a lot bro
do newer version of ide have to run the code first? cuase it doesnt run at the 2 minute mark
Thank you brohan
I get it already! So, are the hex values of the format "0xRRGGBB" for the Color class (R = "Red", G = "Green", B = "Blue")? That's cool.
Where are you importing from? When i do that in the code along it doesnt utilize that the import.
awesome video bro!
It's in NetBeans or vscode?
Thank you for this vid!
in 2:31, i run test and reslut say "Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: C:\Users\cusie\eclipse-workspace\Clock\bin
Caused by: java.lang.module.InvalidModuleDescriptorException: Main.class found in top-level directory (unnamed package not allowed in module" can u pls help me
What I would like to see, is a separate file, a library of sorts, that can be called in other files.
so, I can have several windows, that will call this method, to display across different windows
Thank you so much.
Thank you
Thank you Bro 😎.
This is like my second vid on coding i went from nothing to making this by following the vid and struggling for like 2-3 hours tryna find my mistakes...Was amazing when I found what I did wrong though :)
Thanks
How can I synchronize time between servers in a distributed system by java language?
Cool bro)
Super Broo!!!
This help me a lot , but i got some problems here, when i use this clock.java for 2nd class then i called it on my main.java class the clock.java won't show anything kinda stuck in loop
Thank you !
Can I do this program on bluej?
thanks
Respect
Bro how to use swing in intelj
Thanks Bro Code
Goo Bro Code 😁
thank you and I end 3 conditions
Arigato kamisama
How would I call this in another file?
Maybe the thought behind making the name of the month "MMMMM", was that the word month has 5 letters, thus the 5 M's? Just a guess.
might be!
how to repaint the clock in JPanel
System.out.println("thanks");
System.out.print("Thanks");
I have a question, please!
I tried to make a frame that has two buttons (Stopwatch & Clock), when clicked would produce a new window with each of their respective programs. When I click the button of the stopwatch, it works just fine, but the clock doesn't . The window opens, but it's empty. What's more is that I can't exit out of it by clicking the x button. It's as if the Default operation was DO NOTHING.
I tried to delete the while loop and everything in it by passing it as a comment. The clock frame closes. May anyone please tell me why this is so?
AND THANK YOU ALWAYS, BROO!
same problem T,T .....did you solve it??
@@lazyhashi854 No! I tried a lot. What did you try to fix it? Maybe we can figure something out together.
Muy bueno :)