• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 11:16
CET 17:16
KST 01:16
  • 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 weeklies1ComeBackTV's documentary on Byun's Career !10Weekly 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
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies ComeBackTV's documentary on Byun's Career ! Micro Lags When Playing SC2? When will we find out if there are more tournament Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win
Tourneys
$5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament $100 Prize Pool - Winter Warp Gate Masters Showdow Winter Warp Gate Amateur Showdown #1 RSL Offline Finals Info - Dec 13 and 14!
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
BGH Auto Balance -> http://bghmmr.eu/ Klaucher discontinued / in-game color settings Anyone remember me from 2000s Bnet EAST server? How Rain Became ProGamer in Just 3 Months FlaSh on: Biggest Problem With SnOw's Playstyle
Tourneys
[BSL21] LB QuarterFinals - Sunday 21:00 CET Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] WB SEMIFINALS - Saturday 21:00 CET
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile General RTS Discussion Thread Nintendo Switch Thread
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 The Games Industry And ATVI Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1691 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 States24747 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
Wardi Open
12:00
Monday #66
WardiTV1542
TKL 355
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 355
ProTech125
Liquid`VortiX 94
DivinesiaTV 8
StarCraft: Brood War
Bisu 2376
Sea 2203
Mini 1067
Larva 1061
Light 781
Soma 631
Stork 452
Snow 339
firebathero 247
Rush 189
[ Show more ]
ggaemo 169
Sharp 136
PianO 98
hero 94
Mong 57
Aegong 45
Yoon 42
sorry 41
Bale 37
Movie 32
Terrorterran 23
910 23
soO 22
Shinee 20
Sacsri 13
Dota 2
singsing4870
syndereN1123
XcaliburYe549
Counter-Strike
adren_tv81
Heroes of the Storm
Khaldor208
Other Games
Grubby5992
B2W.Neo1039
crisheroes359
Fuzer 323
Lowko312
hiko273
RotterdaM247
QueenE91
Mew2King81
nookyyy 58
Trikslyr22
RushiSC15
Organizations
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
• WagamamaTV1071
League of Legends
• Nemesis2624
• TFBlade918
Upcoming Events
Monday Night Weeklies
44m
WardiTV Invitational
1d 19h
Replay Cast
2 days
WardiTV Invitational
2 days
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Replay Cast
4 days
Sparkling Tuna Cup
5 days
Replay Cast
6 days
Wardi Open
6 days
Liquipedia Results

Completed

YSL S2
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
BSL Season 21
Slon Tour Season 2
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
ESL Pro League S22

Upcoming

CSL 2025 WINTER (S19)
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.