• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:35
CET 16:35
KST 00:35
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
RSL Offline Finals Info - Dec 13 and 14! Sparkling Tuna Cup - Weekly Open Tournament StarCraft Evolution League (SC Evo Biweekly) Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion Foreign Brood War MBCGame Torrents [ASL20] Ask the mapmakers — Drop your questions Which season is the best in ASL?
Tourneys
Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile ZeroSpace Megathread The Perfect Game
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
JSHOP.CC, NON VBV CC, SPAMMING, RANSOMWARE, BOTNET Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine The Big Programming Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
Formula 1 Discussion 2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
I decided to write a webnov…
DjKniteX
Physical Exertion During Gam…
TrAiDoS
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1662 users

help on making a blackjack game on java!

Blogs > Dark_Luster
Post a Reply
Dark_Luster
Profile Blog Joined May 2007
Korea (South)438 Posts
May 26 2009 23:10 GMT
#1
i'm thinking of using swing.
if someone can help me on this via aim or what not
or just someone that's good at java,
i'll happily give money as a tutoring fee.
please PM me! thank you.

#1 Horangee fan
micronesia
Profile Blog Joined July 2006
United States24745 Posts
May 26 2009 23:21 GMT
#2
What is swing?

Are you planning on a full gui?
ModeratorThere are animal crackers for people and there are people crackers for animals.
Mastermind
Profile Blog Joined April 2008
Canada7096 Posts
May 26 2009 23:46 GMT
#3
On May 27 2009 08:21 micronesia wrote:
What is swing?

Are you planning on a full gui?

lol, swing is a library in Java for making GUIs.
Dark_Luster
Profile Blog Joined May 2007
Korea (South)438 Posts
May 26 2009 23:53 GMT
#4
yeah. swing is like what i need to make my game look better
instead of using objectdraw or what not.
please someone, help!
#1 Horangee fan
Archaic
Profile Blog Joined March 2008
United States4024 Posts
Last Edited: 2009-05-27 00:13:18
May 27 2009 00:03 GMT
#5
I remember going through this...
I'll say start with an array of every single card value, being 2S, 2C, 2H, 2D, 3S, etc. etc.
Then, get an image for each card, or simply create a container field to just hold the text value.
(int)(Math.random()*52) to get a random card for dealing, and have each one have a value.
i.e.
switch(getActionListener.getText().charAt(0)){
case A: int value 11; break;
case 2: int value = 2; break;
case 3: int value = 3; break;
......
case 9: int value = 9; break;
Default: int value =10;
}

if(value==11 && total+value>21)
value=1;

total+=value;


This probably isn't the whole method, but it might help you get started...

EDIT: You don't actually need the suits, at least not in blackjack. Second, you'd have to create a filter so there are no repeats.
Dark_Luster
Profile Blog Joined May 2007
Korea (South)438 Posts
May 27 2009 00:44 GMT
#6
i don't exactly know how to use images for each card.
archaic, would you know how to make this whole blackjack game byyourself?

#1 Horangee fan
King K. Rool
Profile Blog Joined May 2009
Canada4408 Posts
Last Edited: 2009-05-27 01:31:02
May 27 2009 01:29 GMT
#7
lol. I remember doing this in grade 12.

Here's some additions to what Archaic said:

I used suits since you can name your card image files to be 1_heart.jpg or whatever, and be able to get/create the correct image simply by what part of the array you're at (or 2-d array, depending on whatever clever way you want to do the array). Modular arithmetic and constants should make this pretty simple.

Also, instead of a filter you can use 2-3 collections for deck, discarded, and on table (or w/e smart way of implementing this you choose) and simply move objects around. I'd use integers, since you really only will ever need to have 5-6 card objects at max.

edit: Showing images are simple enough, you can extend JPanel or use JButton with ImageIcons I believe (or some sort of Image object, I forget). Are you a beginner to swing?
Dark_Luster
Profile Blog Joined May 2007
Korea (South)438 Posts
May 27 2009 02:15 GMT
#8
yeah. like total beginner. the only information i know is that swing will let you
use own images in the applet. =o=;;;
will someone just help me out via AIM or something?
i just have a couple of questions.
#1 Horangee fan
GHOSTCLAW
Profile Blog Joined February 2008
United States17042 Posts
May 27 2009 02:51 GMT
#9
your best bet is to keep posting questions either in this thread or to create a new blog post for each set of questions. Forums are good and allow you to see different viewpoints from many different people.
PhotographerLiquipedia. Drop me a pm if you've got questions/need help.
EsX_Raptor
Profile Blog Joined February 2008
United States2802 Posts
May 27 2009 03:48 GMT
#10
start by making the cards, the deck, the shuffler, the hands and when you're done with your tools, just put them all together.

java is an oop language and that's the way it should be done.
King K. Rool
Profile Blog Joined May 2009
Canada4408 Posts
May 27 2009 14:46 GMT
#11
Don't have aim, and I'm at work too. Just post whatever questions you have here. I look at TL every couple hours or so, and I'll try to answer whatever questions you have.
R3condite
Profile Joined August 2008
Korea (South)1541 Posts
May 27 2009 16:05 GMT
#12
On May 27 2009 09:44 Dark_Luster wrote:
i don't exactly know how to use images for each card.
archaic, would you know how to make this whole blackjack game byyourself?


u need the picture files... also is it juts the GUI u r having trouble w/ or the nonGUI version as well?
ggyo...
Dark_Luster
Profile Blog Joined May 2007
Korea (South)438 Posts
May 27 2009 20:38 GMT
#13
okay so i got the card,hand,blacjackhand,deck, and blackjackgui(this is the applet)
right now as a rough draft, the cards in my hand are shown as
just a box with (number/suit) how can i replace these with
the actual pictures of the cards?
#1 Horangee fan
h3r1n6
Profile Blog Joined September 2007
Iceland2039 Posts
Last Edited: 2009-05-27 21:32:23
May 27 2009 21:31 GMT
#14
I hate doing anything gui related in Java

It's been some time since I did that, from what I recall is that Swing has some class for Logos/Pictures, but you can also use a JButton and replace it with a picture. This way you automatically have a way to listen for clicks on that card.
Please log in or register to reply.
Live Events Refresh
SC Evo League
12:30
#17
CaptCanuck359
LiquipediaDiscussion
WardiTV 2025
12:00
Group Stage 1 - Group A
WardiTV1233
ComeBackTV 497
IndyStarCraft 250
TaKeTV 231
Rex139
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
IndyStarCraft 265
LamboSC2 168
Rex 143
BRAT_OK 53
StarCraft: Brood War
Calm 4113
Jaedong 1920
EffOrt 689
Stork 596
Mini 584
Light 530
BeSt 511
GuemChi 421
firebathero 350
Hyuk 310
[ Show more ]
ZerO 286
Rush 174
910 144
Larva 124
Killer 102
sorry 70
Sharp 69
PianO 45
ajuk12(nOOB) 41
Mong 35
Barracks 34
soO 25
Rock 20
Terrorterran 19
SilentControl 8
Dota 2
Gorgc5182
qojqva4532
XcaliburYe846
Fuzer 407
420jenkins312
LuMiX1
Counter-Strike
fl0m4026
zeus580
Super Smash Bros
Mew2King127
Heroes of the Storm
Khaldor362
Other Games
B2W.Neo1590
crisheroes401
Hui .307
Happy163
XaKoH 125
DeMusliM50
KnowMe35
ZerO(Twitch)15
Organizations
Other Games
EGCTV975
StarCraft: Brood War
lovetv 9
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Reevou 8
• poizon28 2
• Kozan
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 3177
• lizZardDota294
League of Legends
• Jankos2735
Upcoming Events
PSISTORM Gaming Misc
1h 20m
Freeedom1
IPSL
1h 25m
Dewalt vs ZZZero
BSL 21
4h 25m
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
6h 25m
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
18h 25m
WardiTV 2025
20h 25m
OSC
23h 25m
IPSL
1d 1h
Bonyth vs KameZerg
BSL 21
1d 4h
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
1d 17h
[ Show More ]
Wardi Open
1d 20h
StarCraft2.fi
2 days
Monday Night Weeklies
2 days
Replay Cast
2 days
WardiTV 2025
2 days
StarCraft2.fi
3 days
PiGosaur Monday
3 days
StarCraft2.fi
4 days
Tenacious Turtle Tussle
4 days
The PondCast
4 days
WardiTV 2025
4 days
StarCraft2.fi
5 days
WardiTV 2025
5 days
StarCraft2.fi
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Proleague 2025-12-04
RSL Revival: Season 3
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
WardiTV 2025
META Madness #9
Light HT
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
RSL Offline Finals
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.