• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:38
CEST 15:38
KST 22:38
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Weekly Cups (June 30 - July 6): Classic Doubles1[BSL20] Non-Korean Championship 4x BSL + 4x China7Flash Announces Hiatus From ASL64Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event22
StarCraft 2
General
Weekly Cups (June 30 - July 6): Classic Doubles Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Weekly Cups (June 23-29): Reynor in world title form?
Tourneys
RSL: Revival, a new crowdfunded tournament series FEL Cracov 2025 (July 27) - $8000 live event Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays Korean Starcraft League Week 77
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma
Brood War
General
SC uni coach streams logging into betting site BGH Auto Balance -> http://bghmmr.eu/ ASL20 Preliminary Maps Flash Announces Hiatus From ASL Player “Jedi” cheat on CSL
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [BSL20] Non-Korean Championship 4x BSL + 4x China CSL Xiamen International Invitational The Casual Games of the Week Thread
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2024! Summer Games Done Quick 2025!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion 2024 - 2025 Football Thread NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 744 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 States24669 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 States2801 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
Wardi Open
11:00
#43
WardiTV1344
OGKoka 531
Harstem448
Rex169
IndyStarCraft 165
CranKy Ducklings117
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 531
Harstem 448
Hui .184
Rex 169
IndyStarCraft 165
StarCraft: Brood War
Bisu 3073
Flash 2328
Jaedong 1756
Hyuk 1094
firebathero 707
EffOrt 657
Larva 521
ZerO 478
actioN 454
Soulkey 441
[ Show more ]
Stork 397
Snow 306
Soma 298
GuemChi 163
Mind 133
sSak 118
Light 108
Pusan 106
PianO 94
Sharp 77
JulyZerg 75
hero 73
TY 65
Barracks 48
Yoon 37
Aegong 36
sorry 32
Free 29
zelot 27
GoRush 25
HiyA 24
soO 23
Movie 18
JYJ17
yabsab 17
Terrorterran 11
Shine 10
IntoTheRainbow 10
ivOry 5
Dota 2
qojqva3113
Gorgc2576
XaKoH 629
syndereN301
XcaliburYe297
League of Legends
singsing2583
Dendi1
Counter-Strike
byalli270
markeloff134
Super Smash Bros
Mew2King202
Other Games
hiko1246
B2W.Neo1069
Beastyqt386
crisheroes369
Lowko293
ArmadaUGS140
Liquid`VortiX70
ZerO(Twitch)20
Organizations
Other Games
gamesdonequick38108
StarCraft: Brood War
UltimateBattle 978
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 3069
• WagamamaTV335
League of Legends
• Nemesis6060
Upcoming Events
RotterdaM Event
2h 22m
Replay Cast
10h 22m
Sparkling Tuna Cup
20h 22m
WardiTV European League
1d 2h
MaNa vs sebesdes
Mixu vs Fjant
ByuN vs HeRoMaRinE
ShoWTimE vs goblin
Gerald vs Babymarine
Krystianer vs YoungYakov
PiGosaur Monday
1d 10h
The PondCast
1d 20h
WardiTV European League
1d 22h
Jumy vs NightPhoenix
Percival vs Nicoract
ArT vs HiGhDrA
MaxPax vs Harstem
Scarlett vs Shameless
SKillous vs uThermal
uThermal 2v2 Circuit
2 days
Replay Cast
2 days
RSL Revival
2 days
ByuN vs SHIN
Clem vs Reynor
[ Show More ]
Replay Cast
3 days
RSL Revival
3 days
Classic vs Cure
FEL
4 days
RSL Revival
4 days
FEL
4 days
FEL
5 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs QiaoGege
Dewalt vs Fengzi
Hawk vs Zhanhun
Sziky vs Mihu
Mihu vs QiaoGege
Zhanhun vs Sziky
Fengzi vs Hawk
Sparkling Tuna Cup
5 days
RSL Revival
5 days
FEL
6 days
BSL20 Non-Korean Champi…
6 days
Bonyth vs Dewalt
QiaoGege vs Dewalt
Hawk vs Bonyth
Sziky vs Fengzi
Mihu vs Zhanhun
QiaoGege vs Zhanhun
Fengzi vs Mihu
Liquipedia Results

Completed

BSL Season 20
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
CSL Xiamen Invitational
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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.