• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 05:44
CET 11:44
KST 19:44
  • 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 Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !11Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2
StarCraft 2
General
ComeBackTV's documentary on Byun's Career ! Team TLMC #5: Winners Announced! What's the best tug of war? The Grack before Christmas Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies
Tourneys
OSC Season 13 World Championship $5,000+ WardiTV 2025 Championship $100 Prize Pool - Winter Warp Gate Masters Showdow Sparkling Tuna Cup - Weekly Open Tournament Winter Warp Gate Amateur Showdown #1
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement
Brood War
General
BW General Discussion How soO Began His ProGaming Dreams Klaucher discontinued / in-game color settings BGH Auto Balance -> http://bghmmr.eu/ Recommended FPV games (post-KeSPA)
Tourneys
[Megathread] Daily Proleagues [BSL21] LB SemiFinals - Saturday 21:00 CET [BSL21] WB & LB Finals - Sunday 21:00 CET Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Mechabellum Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile
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
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread 12 Days of Starcraft The Games Industry And ATVI Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced Where to ask questions and add stream?
Blogs
National Diversity: A Challe…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1557 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 States24750 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
Sparkling Tuna Cup
10:00
2025 December Finals
Percival vs RyungLIVE!
ByuN vs NicoractLIVE!
Classic vs TriGGeR
CranKy Ducklings273
IndyStarCraft 131
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 145
IndyStarCraft 131
trigger 71
StarCraft: Brood War
Britney 40536
Sea 6060
GuemChi 1177
Jaedong 950
Hyuk 459
Stork 405
Mong 365
Light 239
Soma 206
hero 177
[ Show more ]
Last 165
ggaemo 137
Rush 115
sorry 93
Shuttle 93
Sharp 92
Mini 91
EffOrt 80
Pusan 79
soO 70
Hyun 57
ToSsGirL 46
Mind 27
yabsab 24
NaDa 22
NotJumperer 19
Terrorterran 16
JulyZerg 14
SilentControl 8
zelot 8
ajuk12(nOOB) 7
eros_byul 0
Dota 2
XcaliburYe454
League of Legends
JimRising 483
C9.Mang0423
Other Games
mouzStarbuck391
Pyrionflax228
Mew2King35
MindelVK8
B2W.Neo6
Organizations
Other Games
gamesdonequick723
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2233
• Lourlo1239
Upcoming Events
OSC
7h 16m
BSL 21
9h 16m
Cross vs Dewalt
Replay Cast
22h 16m
Wardi Open
1d 1h
OSC
2 days
Solar vs MaxPax
ByuN vs Krystianer
Spirit vs TBD
OSC
5 days
Korean StarCraft League
5 days
OSC
6 days
OSC
6 days
Liquipedia Results

Completed

Escore Tournament S1: W1
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL Season 21
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
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

Upcoming

CSL 2025 WINTER (S19)
Escore Tournament S1: W2
Escore Tournament S1: W3
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
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.