I dont really think this willl get replied too but whenever i type "s.setFullScreen(dm, this);" and "s.restoreScreen();" it says i need to create the setFullScreen in the screen class...but its already created...same as restoreScreen please help
Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setBackground(Color) is undefined for the type bucky The method setForeground(Color) is undefined for the type bucky The method setFont(Font) is undefined for the type bucky The method setFullScreen(DisplayMode, JFrame) in the type Screen is not applicable for the arguments (DisplayMode, bucky) at bucky.run(bucky.java:13) at bucky.main(bucky.java:9)
I have an error in my code! setBackground and setForeground and setFont goes red and says it's undefined for type 'bucky'. 1 quick fix: createMethod 'setFont(Font)'
this refers to the instance of object bukey (a JFrame), minute 5:20, not to "Screen s" object. Sorry if this confuses anybody, or if this subject was discussed .
Exception in thread "main" java.lang.NullPointerException at screen.toNormalScreen(screen.java:26) at game.run(game.java:21) at game.main(game.java:8)
I'm getting a major problem with my Screen class now. Everything works fine up until the point where it restores the window, and I get an Invalid display mode IllegalArgumentException right after the dispose() method, on vc.setFullScreenWindow(null);... Not sure what I should do, because I had it working at one point.
@korkypnoy I had the same problem i realised what went wrong, in the class screen or whatever you named your class for the screen, you made a method to restore the screen. This is whats wrong, you either gave the method a different name or you didnt make it.
Because if you make a method with neither Public or Private as modifier, it's public to anything in the same package, but nowhere outside of that package. But make sure setForeground is still in the method.
I have the same issue as Gooter, it all runs fine and text appears and I can change all that except the background colour is always black. It wont change. Any help would be appreciated.
im getting this error message Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setFullScreen(DisplayMode, Main) is undefined for the type Screen The method restoreScreen() is undefined for the type Screen
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Antialiased text mode is not compatible with Global antialiasing enable key
Thank you very much Greg||bucky, I've watched all your Java Programming Tutorials during 3days. I've studied a lot from you.
I've got some problem. When I start this program on Windows 7, it have errors in this code:
public void restoreScreen(){ Window w = vc.getFullScreenWindow(); if (w != null){ w.dispose(); //problem here } vc.setFullScreenWindow(null); //and problem here }
But the same program is working perfect on Windows XP.
when i type "b.run(dm);" i get "- Syntax error on token "dm", VariableDeclaratorId expected after this token - Syntax error on token(s), misplaced construct(s)"
I got this error when running everything from the last video:
Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setFullScreen(DisplayMode, Main) is undefined for the type Screen The method restoreScreen() is undefined for the type Screen at main.Main.run(Main.java:18) at main.Main.main(Main.java:8)
Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setBackground(Color) is undefined for the type bucky The method setForeground(Color) is undefined for the type bucky The method setFont(Font) is undefined for the type bucky The method setFullScreen(DisplayMode, JFrame) in the type Screen is not applicable for the arguments (DisplayMode, bucky)
Where do you put the g.clearRect(0, 0, getWidth(), getHeight());
Please put the code for me!!!!!!! public void paint(Graphics g){ if(g instanceof Graphics2D){ Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
@TheVSTutorial Yeah, I tried that first and it didn't make a difference in my case - wish it did though; it would have been an easier fix. In my case, the resolution was irrelevant as whether 800, 600 or 1680, 900, I still got a full screen display with the fix I have below. On their own, they did nothing. I even put my own refresh rate by changing the Display.Mode.REFRESH_RATE_UNKNOWN call with a 60 - still didn't work.
If you're your screen flashes black and you see nothing at all, or this just plain doesn't work, try removing or commenting out this line of code from Screen.java:
{ vc.setDisplayMode(dm); } - just leave the try/catch block empty and save the file.
Now go to your main, in this case, your Bucky.java class, and change the OS from 16 to 32 or 64 bit accordingly in this line of code:
{ DisplayMode dm = new DisplayMode(800,600,32, DisplayMode.REFRESH_RATE_UNKNOWN); }
@lnfiniteKnowledge Thanks for the help, but once i do this (no matter what change, 32, 64) it has a transparent screen, but the writing (this is gunna be awesome) is still there in the color i chose. Can you help please?
Exception in thread "main" java.awt.IllegalComponentStateException: The frame is displayable. at java.awt.Frame.setUndecorated(Unknown Source) at screen.setFullScreen(screen.java:13) at buck.run(buck.java:23) at buck.main(buck.java:8)
when i tried to compile it the first error i get is that it GraphicsEnviroment doesnt work so the Screen method is broken the second is all the setForeground() things dont exist so none of this works please someone help me
Can you help me? My screen just turns black but the text shows up. I try every single color for my background but it just stays black. Whats wrong with it.
Oh another thing, if you set the resolution to be the same as your monitor's natural resolution, it will run smoother.
My monitor is naturally 1920x1080 so changing it to 800x600 makes it pause for a couple seconds before displaying anything at all. But setting it to 1920x1080 it pops up instantly no problem.
It works! .. except the background is always black no matter what I set it to on all bit depths. Any suggestions? I think it might just be laptop suckage.
really thanks for this tutorial and i learned many useful things from it
but when i tried this code it give me an exception can u help me?
the exception is: Exception in thread "main" java.lang.IllegalArgumentException: Invalid display mode at sun.awt.Win32GraphicsDevice.setDisplayMode(Unknown Source)
I dont really think this willl get replied too but whenever i type "s.setFullScreen(dm, this);" and "s.restoreScreen();" it says i need to create the setFullScreen in the screen class...but its already created...same as restoreScreen please help
Jaltor13 1 day ago in playlist Java Game Development Tutorials
on line 19 you use setFullScreen
but in the Screen class you made, it's called setFullScreenDevice (so change to this)
I hope that helps anyone. I had this problem.
bmgag19 2 days ago
Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setBackground(Color) is undefined for the type bucky The method setForeground(Color) is undefined for the type bucky The method setFont(Font) is undefined for the type bucky The method setFullScreen(DisplayMode, JFrame) in the type Screen is not applicable for the arguments (DisplayMode, bucky) at bucky.run(bucky.java:13) at bucky.main(bucky.java:9)
WTF!!!!!!!
MinecraftEliteGamer 6 days ago in playlist Java Game Development Tutorials
@MinecraftEliteGamer At the beginning of your class (public class bucky) its supposed to say
public class bucky extends JFrame
draken4200 2 days ago in playlist Java Game Development Tutorials 2
@draken4200 You have just fixed all of my problems, thank you soo much :)
KitsMinecraftMusic 12 hours ago
java.lang.NullPointerException gooddammmnitt!!!!
BstlNas 1 week ago
public void paint(Graphics g) { g.clearRect(0,0,getWidth(),getHeight()); g.drawString("This is awesom", 200, 200); }
SuperAtheist 1 week ago in playlist Java Game Development Tutorials
I'm using latest JDK and works fine for me. Bare in mind 'void paint' is case sensitive. Must be lower case.
TeachComputing 1 week ago
Mine doesnt turn pink. It turns black
ProMadnessX 1 week ago
bucky i am not getting the pink screen ...what wrong with that..????
bigjforever 1 week ago in playlist Java Game Development Tutorials
its not turning pink
Ronaldoo91 1 week ago
People, don't forget to extend the bucky class with JFrame
public class bucky extends JFrame
ISmashedMyKeyboard 2 weeks ago in playlist Java Game Development Tutorials
I have an error in my code! setBackground and setForeground and setFont goes red and says it's undefined for type 'bucky'. 1 quick fix: createMethod 'setFont(Font)'
crisisminers 2 weeks ago
@crisisminers same
TheAnimateor 2 weeks ago
@crisisminers the complete fix = setFont (new Font("Arial", font.PLAIN, 24));
CookieMotion 1 week ago
this refers to the instance of object bukey (a JFrame), minute 5:20, not to "Screen s" object. Sorry if this confuses anybody, or if this subject was discussed .
TheDradud 3 weeks ago in playlist Java Game Development Tutorials
Guys why I got white screen and not pink just white but script is same as boston
V3rnixTV 3 weeks ago in playlist More videos from thenewboston
put this
g.clearRect(0, 0, getWidth(), getHeight());
g.drawString("Hello My Screen", 200, 200);
it works
madjo23s 3 weeks ago
When I run this it says:
Exception in thread "main" java.lang.NullPointerException at screen.toNormalScreen(screen.java:26) at game.run(game.java:21) at game.main(game.java:8)
What's going on?
TriCrose 3 weeks ago
@TriCrose it means you messed up some were watch the video again and see if u have something different then what bucky has
warlord950 3 weeks ago
For those who are having problems with the background not changing, insert "paint.super(g);" above the g.drawString line.
Kingleopold789 3 weeks ago
I'm getting a major problem with my Screen class now. Everything works fine up until the point where it restores the window, and I get an Invalid display mode IllegalArgumentException right after the dispose() method, on vc.setFullScreenWindow(null);... Not sure what I should do, because I had it working at one point.
Darkgold1021 1 month ago
is s.restoreScreen(); a built in method? it's not recognizing it in my program :(
korkypnoy 1 month ago
@korkypnoy I had the same problem i realised what went wrong, in the class screen or whatever you named your class for the screen, you made a method to restore the screen. This is whats wrong, you either gave the method a different name or you didnt make it.
icommentonvideos1 1 month ago in playlist Java Game Development Tutorials
im on Ubuntu if that matter but i did background orange and it made it an orange gradient
why?
houdini0118 1 month ago in playlist Java Game Development Tutorials
i get loads of errors on the setBackround, SetForeGround and SetFont
ShadowIrOnIcz 1 month ago in playlist Java Game Development Tutorials
This has been flagged as spam show
@ShadowIrOnIcz Same
i also got loads of errors on the setBackround, SetForeground and SetFont
TheAnimateor 2 weeks ago
I get a problem, the console tells me "java.lang.NullPointerException", what's that suppose to mean? Help please!
jikiwaify 1 month ago in playlist Java Game Development Tutorials
How do you add TextField in Full Screen mode?? I know how to add in normal form applet but i'm stuck in full screen. Help please!!
JudgementDesu 1 month ago
Same with the color problem, but I got so excited I didn't even care :D:D:D:D:D
sev07knight 1 month ago
I get an error on setBackground, setForeground and setFont. It says that i should create a method 'setForeground(Color)'
TheBestLucarioFan 1 month ago in playlist Java Game Development Tutorials
@TheBestLucarioFan Did you write this:
"public void run(DisplayMode dm){ setBackground(Color.PINK); setForeground(Color.WHITE);"
Because you might've wrote this instead:
"public void run(DisplayMode dm){ setBackground(Color.PINK); }setForeground(Color.WHITE);"
Because if you make a method with neither Public or Private as modifier, it's public to anything in the same package, but nowhere outside of that package. But make sure setForeground is still in the method.
Legendgreat96 1 month ago
@TheBestLucarioFan Did you remember to make bucky extend JFrame?
VilleIbz 1 month ago
This has been flagged as spam show
If you are getting a black screen, try add this code at the top of your paint() method:
g.clearRect(0, 0, getWidth(), getHeight());
GlobalDuty 1 month ago
How else wants that Print Screen as their Desktop background?
MrSentientSimian 1 month ago in playlist Java Game Development Tutorials
Did you delete the stuff in bucky and start over with that, or did you create a new class file?
PJohnnyJX 1 month ago in playlist Java Game Development Tutorials
who would dislike these videos?
BigletJohnson 1 month ago
Could not find or load main class Bucky this is my problem. where is the solution?
bitOhumor 2 months ago
I found a solution for the problem with the black screen.. Hopefully it will help you guys too:)
Change
setBackground(Color.PINK);
setForeground(Color.WHITE);
To this:
setBackground(Color.pink);
setForeground(Color.white);
helgeandre 2 months ago
Black Background... anyone else lol?
hoddie54 2 months ago
@hoddie54 me.... I get the letters fine, but the bg is black :'(
TheDgdc 3 weeks ago
g.clearRect(0, 0, getWidth(), getHeight());
sinthorias 2 months ago in playlist Java Game Development Tutorials 5
Comment removed
Justeenoster 2 months ago
I have the same issue as Gooter, it all runs fine and text appears and I can change all that except the background colour is always black. It wont change. Any help would be appreciated.
midleton92 2 months ago
Nevermind, I fixed it:3
Atyninee 2 months ago
Mine didn't work until I change run to rn:l
Atyninee 2 months ago
oooohhh.... as soon as you set some text(or image(anything)) the screen will be fine.
dimucchu14 2 months ago in playlist Meer video's van thenewboston
Comment removed
dimucchu14 2 months ago in playlist Meer video's van thenewboston
Wonder why Notch didn't do this...
QuantumSicarius 2 months ago in playlist Java Game Development Tutorials
@QuantumSicarius cu he didnt want minecraft to be full screen.
OCoptimusconvoy 2 months ago in playlist More videos from thenewboston
@OCoptimusconvoy Press F11 and see what happens XD
pontena 2 months ago
It runs just fine but i don't get a pink screen! It's black no matter what color I choose and if I let it sleep for a longer time, whats wrong?!
Goooter 2 months ago
@Goooter I have the EXACT same problem, I haven't fixed it yet, I just in the Paint() method put a g.setColor(Color.pink);
then put a g.fillRect(0,0,800,600);
then set the color back to white and had the text be displayed and it looks like it would
mylifeis2coolcmc2 2 months ago in playlist Java Game Development Tutorials
i got a black background help please
lightningchicken12 2 months ago
Er, my background was black, but it still worked
julienmauricemort 2 months ago in playlist Java Game Development Tutorials
@julienmauricemort yeah same here i don't know whats wrong with it
lightningchicken12 2 months ago
ye compiler consa he
prateekverma021 2 months ago
Thanks, this is awesome ! :)
az000990 2 months ago in playlist Java Game Development Tutorials
how about the fullscreen like ALT+F4 ?
ttttkk2 3 months ago
5:32 TryCEPTION! :3
NorwayHack 3 months ago 4
Im getting the words but the background just isnt working for me idk what the problem is
12theblackfox21 3 months ago
When I ran mine I just got really excited and it was just... epic. Thank you bucky!
302MineCrafter 3 months ago in playlist Java Game Development Tutorials
Mine is not turning pink for some reason. Help!
rambolikesCOD 3 months ago in playlist Java Game Development Tutorials 34
@rambolikesCOD
did you import awt.*;?/read the top comment.
SnowfireGames 3 months ago in playlist Java Game Development Tutorials
@SnowfireGames i did import that and i looked at the top comment neither worked.
rambolikesCOD 3 months ago
@rambolikesCOD try to let the thread sleep for longer. It might be that your pc is a little slow :P
TheDopeyGamer 3 months ago
@rambolikesCOD Let it sleep to 10000 then.
chrisall76 2 months ago
@rambolikesCOD
DisplayMode(500,400,16, DisplayMode.REFRESH_RATE_UNKNOWN);
//try changing the resolution
krazaz101 1 month ago
Thanks for all.
I dont understand "this" statement in setFullScreen. We pass there the s object or bucky?
If we pass s why??? it is not a JFrame object...
Thanks in advance.
LiberulArbitru 4 weeks ago
@LiberulArbitru this means the object created from this class (bucky). so he passes a bucky object by "this", not the s.
3ngi 3 weeks ago in playlist Java Game Development Tutorials
Comment removed
TheThiorix 3 months ago in playlist Java Game Development Tutorials
Wow, Java is so easy.
winPGRM 3 months ago in playlist Java Game Development Tutorials
how do u run as?
BlueMario72 3 months ago
strange episode to ask, which version of Eclipes do you use, Java EE Devs or just Java Devs?
smoshfan10 3 months ago in playlist More videos from thenewboston
Comment removed
TheeDeamon 3 months ago
GraphicsEnvironment cannot be resolved.... I have imported everything, retyped 5 times and to no avail. Please someone help?
Corhunger 3 months ago in playlist Java Game Development Tutorials
@Corhunger Nevermind... It seems it did not like the keyword 'new'.
Corhunger 3 months ago in playlist Java Game Development Tutorials
im getting this error message Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setFullScreen(DisplayMode, Main) is undefined for the type Screen The method restoreScreen() is undefined for the type Screen
manasume 3 months ago
It was just a black screen with the text I posted, no pink or anything
AutomatonGames 3 months ago in playlist Java Game Development Tutorials
Hmm, my setForeground and setBackground is saying to create a new method for them. What should I do?
JamEngulfer221 3 months ago in playlist Java Game Development Tutorials
@JamEngulfer221 did u do the imports correctly?
14koder 3 months ago in playlist Java Game Development Tutorials
@14koder I think so. It didn't suggest I import them when I hovered over them. Should I have, because I think I imported java.awt.*
JamEngulfer221 3 months ago
How i can make a not Fullscreen Display?
tidesmain 4 months ago
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Antialiased text mode is not compatible with Global antialiasing enable key
i get this error with java 7
Tibblist 4 months ago in playlist More videos from thenewboston
:) thanks
evilatsnipe 4 months ago
i DON'T KNOW WHAT ARE YOU SAYING
skildfrix 4 months ago
Thank you very much Greg||bucky, I've watched all your Java Programming Tutorials during 3days. I've studied a lot from you.
I've got some problem. When I start this program on Windows 7, it have errors in this code:
public void restoreScreen(){ Window w = vc.getFullScreenWindow(); if (w != null){ w.dispose(); //problem here } vc.setFullScreenWindow(null); //and problem here }
But the same program is working perfect on Windows XP.
Excuse me for my English.Thanx
TheGydriy 4 months ago in playlist Java Game Development Tutorials
Did you guys out the "public class bucky extends JFrame {
?
jicast21 4 months ago
what do i select as the main class?
zaedyn2 4 months ago
thenewboston's videos are teaching me ten times more than my college professors...
StateCCM 4 months ago
help weird error? Could not find or load main class bucky
zaedyn2 4 months ago
Screen s = new Screen();
^
?? cant find symbol class Why tho??
xxShanexxxx 4 months ago in playlist More videos from thenewboston
when i type "b.run(dm);" i get "- Syntax error on token "dm", VariableDeclaratorId expected after this token - Syntax error on token(s), misplaced construct(s)"
TheBasinRran 4 months ago
2:52, this is a comment for me cos im gonna stop watching for now resume bit later :)
amaarmc 4 months ago
Where is the DisplayMode method? does anyone know the video or the code for it??
matlymoko 4 months ago in playlist Java Game Development Tutorials
I get screen, but there is no text on it .. ?? Compiled using NetBeans 6.9 on Fedora15
clzola20 4 months ago in playlist Java Game Development Tutorials
I get an error on s.setFullScreen(dm, this);
It wants me to change something in the screen class, but when I do, It screws up and makes tons more errors.
JamEngulfer221 5 months ago in playlist Java Game Development Tutorials
please help me..i tried this on netbeans..when i run the project it says
build successful (total time 5 seconds) but nothing come on the screen..
what to do??im confused..please help
pranjal619 5 months ago in playlist Java Game Development Tutorials
Comment removed
pranjal619 5 months ago in playlist Java Game Development Tutorials
Exception in thread "main" java.lang.Error: Unresolved compilation problem: at display.main(display.java:5) help
ChromeHDTutorials 5 months ago
That awkward moment when you forget extends JFrame...
michaeldcurry1 5 months ago 47
@michaeldcurry1 my god... the same thing happened to me, and because of your comment, it is fixed. i love you.
mransom565 5 months ago
@mransom565 :L No problem, it drives you crazy right?
michaeldcurry1 5 months ago
@michaeldcurry1 Lol I was scrolling down to write a comment about getting an error on "setBackground", read your comment.... Oh thx bro lol
AutomatonGames 3 months ago in playlist Java Game Development Tutorials
@AutomatonGames :L Yeah, loads of people forget it.
michaeldcurry1 3 months ago
@michaeldcurry1 Thanks you sooo much, its beeen like and hour im trying to fix my prob XD
TheMrRedPepper 1 month ago
This has been flagged as spam show
Can i put This playlist ON Over Web Site ????
I am lecturer at Gujarat University (India).
Pls Reply me on
jig4physics@gmail.com
drjslab.org
Thanks
jig4physics 5 months ago in playlist Java Game Development Tutorials
Guys help me, i did this by netbeans and it says:
Exception in thread "main" java.lang.NullPointerException
at jotai.screen.restoreScreen(screen.java:44)
at jotai.Mainn.run(Mainn.java:39)
at jotai.Mainn.main(Mainn.java:24)
Java Result:
kauppijesse 6 months ago
We have taken over our entire screen... now onto the rest of the world!
DarkYuan4 6 months ago in playlist Java Game Development Tutorials
Yo dawg, we put a try block inside yo try block, so you can catch yo thread while you catch this!
oakland5353 6 months ago in playlist TheNewBoston - Java Game Development
Central*
amaarmc 6 months ago
For centrak letters do 325,325
amaarmc 6 months ago
I got this error when running everything from the last video:
Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setFullScreen(DisplayMode, Main) is undefined for the type Screen The method restoreScreen() is undefined for the type Screen at main.Main.run(Main.java:18) at main.Main.main(Main.java:8)
WhiteShadow1415 6 months ago
why are the letters not centered?
hotketchup99 6 months ago
Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method setBackground(Color) is undefined for the type bucky The method setForeground(Color) is undefined for the type bucky The method setFont(Font) is undefined for the type bucky The method setFullScreen(DisplayMode, JFrame) in the type Screen is not applicable for the arguments (DisplayMode, bucky)
TwBit 6 months ago
@TwBit
you probably forget to extends JFrame
tomatocurry1 6 months ago in playlist TheNewBoston - Java Game Development
@tomatocurry1 Son of a bitch... that was it, thank you so much.
TwBit 6 months ago
Please someone reply!!!!!!!!!!!!
Where do you put the g.clearRect(0, 0, getWidth(), getHeight());
Please put the code for me!!!!!!! public void paint(Graphics g){ if(g instanceof Graphics2D){ Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
DeejayCutsy 6 months ago
Comment removed
JUNAIDSAFDAR54 6 months ago
Can any one help me i get a white screen =S
deadlyko1 6 months ago in playlist Java Game Development Tutorials
This has been flagged as spam show
i have added g.clearRect(0, 0, getWidth(), getHeight()); in paint mmethod but still it is showing black screen .......plzz helpppp
ishantgaurav 6 months ago
HELP I GOT THIS ERROR
Syntax error on token "DisplayMode", delete this token REFRESH_RATE_UNKNOWN cannot be resolved or is not a field
Undeadflayme 7 months ago
@Undeadflayme Are you familiar with java at all? if not then it will take you a while to figure it out.
RASHTG 6 months ago
@RASHTG thanx that was helpful -_-
Undeadflayme 6 months ago
mine wont work:
Screen s = new Screen(); try{ s.setFullScreen(dm, this); try{ Thread.sleep(5000); }catch(Exception ex){} }finally{ s.restoreScreen(); } } public void paint (Graphics g){ g.drawString("This is gonna be awesome", 200, 200); }
554danny 7 months ago
why pink dindnt function?
public void run(DisplayMode dm){ setBackground(Color.PINK); setForeground(Color.RED); setFont(new Font("Arial", Font.PLAIN,24)); Screen s = new Screen(); try{ s.setFullScreen(dm, this); try{ Thread.sleep(5000); }catch(Exception ex){} }finally{ s.restoreScreen(); } }
TheFedegaza1 7 months ago
@TheFedegaza1
it is same with me
i asked that question on the other post too
awesomelemonade 7 months ago
why does it say the setBackground(Color.PINK); is wrong???
awesomelemonade 7 months ago in playlist Game Tutorial - The New Boston - High Quality
@awesomelemonade
CodPlayMakers 6 months ago
i just set the resolution for fullscreen to 1680,945 its my screen resolution xD
TheVSTutorial 8 months ago
@TheVSTutorial Yeah, I tried that first and it didn't make a difference in my case - wish it did though; it would have been an easier fix. In my case, the resolution was irrelevant as whether 800, 600 or 1680, 900, I still got a full screen display with the fix I have below. On their own, they did nothing. I even put my own refresh rate by changing the Display.Mode.REFRESH_RATE_UNKNOWN call with a 60 - still didn't work.
lnfiniteKnowledge 8 months ago
If you're your screen flashes black and you see nothing at all, or this just plain doesn't work, try removing or commenting out this line of code from Screen.java:
{ vc.setDisplayMode(dm); } - just leave the try/catch block empty and save the file.
Now go to your main, in this case, your Bucky.java class, and change the OS from 16 to 32 or 64 bit accordingly in this line of code:
{ DisplayMode dm = new DisplayMode(800,600,32, DisplayMode.REFRESH_RATE_UNKNOWN); }
Save the file, and run.
lnfiniteKnowledge 8 months ago 4
@lnfiniteKnowledge Thanks for the help, but once i do this (no matter what change, 32, 64) it has a transparent screen, but the writing (this is gunna be awesome) is still there in the color i chose. Can you help please?
dylantec 3 months ago
3:15 White isn't a color! It's a shade! Java's wrong!
throughthefireTV 8 months ago
bah i had wrote setBackground(color.PINK) instead of setBackground(Color.PINK)
sortedAndOntoTheNext
speedwaygamer 8 months ago
neat
jmac217x 8 months ago
Woot it works
TheCp2388 8 months ago
omg wtf i done exactly what he done, and setBackround foreground and font all come up red, and setFullscreen
MrJimarla 8 months ago
@MrJimarla oops i forgot to make it extend JFrame
MrJimarla 8 months ago 3
@MrJimarla Had the same problem, thanks!
dabu002 8 months ago
THIS IS AWESOME! XD
MegaTrekant 8 months ago
If you are getting a black screen, try add this code at the top of your paint() method:
g.clearRect(0, 0, getWidth(), getHeight());
gfloodsie 8 months ago 65
@gfloodsie thx
MrJimarla 8 months ago
@gfloodsie THANKS!!!
MurleySwurley18 8 months ago
@gfloodsie TTTTTTTTTTThhhhhhhhhhhhhhhhhhhhhhaaaaaaaannnnnkkkkkkkkkkkkk yyyyyyyyyyyyyooooooooooooooouuuuuuuuuuuuuuuu so much now it works
goodadams1 7 months ago
@gfloodsie Thanks!
zerohourkevin 6 months ago
@gfloodsie this worked but it cuts the sides of my screen short so that it's not truely full screen
jackasson1 4 months ago
@gfloodsie WoW !
0ahmed00 2 months ago
interesting i got it to work
warnexus 9 months ago
I am getting a runtime exception
Exception in thread "main" java.awt.IllegalComponentStateException: The frame is displayable. at java.awt.Frame.setUndecorated(Unknown Source) at screen.setFullScreen(screen.java:13) at buck.run(buck.java:23) at buck.main(buck.java:8)
Also the screen looks black. What do I do.
ankit2801 9 months ago
when i tried to compile it the first error i get is that it GraphicsEnviroment doesnt work so the Screen method is broken the second is all the setForeground() things dont exist so none of this works please someone help me
TheTribet 9 months ago
my screen has no background it is just transparent
spambrie1111999 9 months ago
what I don't like is when you change the code in a file w/o us seeing
MattNow14 9 months ago
We won't handle it. Cause I don't plan on messing up. ^_^
vbtutorials12 9 months ago
@iosonoxx Thanks very much! You are the man!
<3
thiago3277 9 months ago
Hey guys could someone please help me?
I did exactly what's on this tutorial and on the previous one (reviewed 3 times)
But when I run the application, my screen just goes black, nothing appers on it,
and then after a few seconds the application closes (as it should).
thiago3277 9 months ago
how would you create it as a web applet rather than full screen or window?
kmf632 9 months ago
@DGArtistsInc
make sure you have "public class bucky extend JFrame { ....
} "
randdomrobert 9 months ago
man display is coming but only wite screen no pink and font after 2 seconds its going y??
moulanaaaa 9 months ago
I can set the Foreground and Font, but not the Background?
FrankSquirel 9 months ago
I would help if bucky put the code for his classes in the description so we can see where we made an error if we did
ThEwOtSiT182 9 months ago
how come bucky used to type at the start of the string main (String args[]) and now he does (String[] args)... Does it make a difference???
ThEwOtSiT182 9 months ago
@ThEwOtSiT182 no. It's just 'tradition' or 'etiquette' to use String[] args.
But when declaring any other array of variables, it's best to use, for example, int arrayofints[].
superkellerman8D 9 months ago
I didn't have the black screen problem like everyone else is talking about
jynxgizmo 10 months ago
Can you help me? My screen just turns black but the text shows up. I try every single color for my background but it just stays black. Whats wrong with it.
Thank you for your help
sirmellocello 10 months ago
@sirmellocello same here...
gatoo23 10 months ago
Oh another thing, if you set the resolution to be the same as your monitor's natural resolution, it will run smoother.
My monitor is naturally 1920x1080 so changing it to 800x600 makes it pause for a couple seconds before displaying anything at all. But setting it to 1920x1080 it pops up instantly no problem.
Danm I/O
misturbobo 10 months ago
Hey if any of you guys are having issues with this not displaying anything on your monitor, it could be the refresh rate,
so for the line:
DisplayMode dm = new DisplayMode(800,600,16, DisplayMode.REFRESH_RATE_UNKNOWN);
try changing it to:
DisplayMode dm = new DisplayMode(800,600,16,60);
misturbobo 10 months ago
It works! .. except the background is always black no matter what I set it to on all bit depths. Any suggestions? I think it might just be laptop suckage.
callmepaul 10 months ago
hi
really thanks for this tutorial and i learned many useful things from it
but when i tried this code it give me an exception can u help me?
the exception is: Exception in thread "main" java.lang.IllegalArgumentException: Invalid display mode at sun.awt.Win32GraphicsDevice.setDisplayMode(Unknown Source)
ma7O50 10 months ago
hi
my name is mahmoud
really thanks for this tutorial and i learned for it many useful things
but when i tried this code it give me an exception can u help me ?
ma7O50 10 months ago