Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Other Programming › Java › Java menu

TalkingJava menu

Posts 1–2 of 2 · Page 1 of 1
killbunny51
killbunny51
Java menu
Hi its me, i know java, so i thought i might help u guys out, i just finished making a menu in java and im going to give you the source code... FREEE. It's not noob-proofed, you can have it.
here:

Menu.java:
Code:
import java.awt.Canvas;
import java.aw*****lor;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.BufferStrategy;

public class Menu extends Canvas implements Runnable, KeyListener {
	int FWidth = 1000;
	int FHeight = 1200;
	int[] MStats = { 0, 0, 0, 0};
	int period = 10;
	double MPosX = 10;
	double MPosY = 20;
	int MWidth = 170;
	int MHeight = 0;
	long newfps = 0;
	int waited = 0;
	static int selected = 0;
	
	
	public long timeTaken = 0;
	public long sleepTime = 0;
	long beginTime = 0;
	long fps = 30;
	long elapsed = 0;
	
	public Graphics g;
	public BufferStrategy b;
	
	private Thread t;
	private static final long serialVersionUID = 1L;
	
	String[] MItms = { "FPS", "Random menu pos", "Menu color (fill)", "Menu color (border)" };
	String[] MOpts = { "Off On", "Off On", "Def. Red Green Blue Orange", "Def. Red Green Blue Orange"};
	
	Color OffClr = Color.red;
	Color OnClr = Color.green;
	Color SelClr = Color.orange;
	Color BGClr = Color.black;
	Color MenuClrBorder = Color.gray.darker();
	Color MenuClrFill = MenuClrBorder.darker().darker();
	
	public Menu(){
		this.setIgnoreRepaint(true);
		this.setBounds(0, 0, FWidth, FHeight);
		this.setBackground(BGClr);
		
		this.setVisible(true);
	}
	
	public void addNotify(){
		super.addNotify();
		this.createBufferStrategy(2);
		this.b = this.getBufferStrategy();
		this.addKeyListener(this);
		requestFocus();
		
		start();
	}
	
	public void start(){
		if(t == null){
			t = new Thread(this);
			t.start();
		}
	}
	public void run() {
		while(true){
			beginTime = System.currentTimeMillis();
			
			Update();
			Render();
			Draw();
			
			timeTaken = System.currentTimeMillis();
			sleepTime = period - timeTaken;
			
			
			try{
				t.sleep(sleepTime);
			}
			catch(Exception e){
				
			}
			newfps = 0;
			elapsed = beginTime - timeTaken;
			newfps = (int) (100/elapsed);
			newfps = Math.abs(Math****und(newfps));
			waited++;
		}
	}
	public void Update(){
		
	}
	public void Render(){
		MHeight = MItms.length*10+5;
		g = b.getDrawGraphics();
		g.setColor(BGClr);
		g.fillRect(0, 0, FWidth, FHeight);
		
		if (MStats[0] == 1){
			if(waited >= 275){
				g.setColor(Color.red);
				g.drawString("Current FPS: "+newfps, 0, 10);
				fps = newfps;
				waited = 0;
			}
			g.setColor(Color.red);
			g.drawString("Current FPS: "+fps, 0, 10);
		}
		if(MStats[1] == 1){
			MPosX = Math.random()*650;
			MPosX = Math****und(MPosX);
			MPosY = Math.random()*450;
			MPosY = Math****und(MPosY);
			MStats[1] = 0;
		}
		if(MStats[2] > 0){
			if(MStats[2] == 1){
				MenuClrFill = Color.red.darker().darker();
			}
			if(MStats[2] == 2){
				MenuClrFill = Color.green.darker().darker();
			}
			if(MStats[2] == 3){
				MenuClrFill = Color.blue.darker().darker();
			}
			if(MStats[2] == 4){
				MenuClrFill = Color.orange.darker().darker();
			}
		} else {
			MenuClrFill = Color.gray.darker().darker().darker();
		}
		if(MStats[3] > 0){
			if(MStats[3] == 1){
				MenuClrBorder = Color.red.darker().darker();
			}
			if(MStats[3] == 2){
				MenuClrBorder = Color.green.darker().darker();
			}
			if(MStats[3] == 3){
				MenuClrBorder = Color.blue.darker().darker();
			}
			if(MStats[3] == 4){
				MenuClrBorder = Color.orange.darker().darker();
			}
		} else {
			MenuClrBorder = Color.gray.darker();
		}
		g.setColor(MenuClrBorder);
		g.drawRect((int) MPosX, (int) MPosY, MWidth, MHeight);
		g.drawRect((int) MPosX-1, (int) MPosY-1, MWidth+2, MHeight+2);
		g.drawRect((int) MPosX-2, (int) MPosY-2, MWidth+4, MHeight+4);
		g.setColor(MenuClrFill);
		g.fillRect((int) MPosX+1, (int) MPosY+1, MWidth-1, MHeight-1);
		int i = 0;
		int j = 1;
		while(i<MItms.length){
			if(MStats[i] == 0){
				Color CClr = OffClr;
				g.setColor(CClr);
			} else {
				Color CClr = OnClr;
				g.setColor(CClr);
			}
			if(i == selected){
				Color CClr = SelClr;
				g.setColor(CClr);
			}
			String loc1 = MOpts[i];
			String[] loc2 = loc1.split(" ");
			g.drawString(MItms[i],(int) MPosX+3, j*10+(int) MPosY+3);
			g.drawString(loc2[MStats[i]],(int) MPosX+129, j*10+(int) MPosY+3);
			i++;
			j++;
		}
	}
	public void Draw(){
		if(!b.contentsLost()){
			b.show();
			if(g != null){
				g.dispose();
			}
		}
	}

	@override
	public void keyPressed(KeyEvent e) {
		if(e.getKeyCode() == KeyEvent.VK_DOWN){
			if(selected < MItms.length - 1){
				selected++;
			} else {
				selected = 0;
			}
		}
		if(e.getKeyCode() == KeyEvent.VK_UP){
			if(selected == 0){
				selected = MItms.length - 1;
			} else {
				selected--;
			}
		}
		if(e.getKeyCode() == KeyEvent.VK_LEFT){
			String[] opts = MOpts[selected].split(" ");
			if(MStats[selected] == 0){
				MStats[selected] = opts.length - 1;
			} else {
				MStats[selected]--;
			}
		}
		if(e.getKeyCode() == KeyEvent.VK_RIGHT){
			String[] opts = MOpts[selected].split(" ");
			if(MStats[selected] < opts.length - 1){
				MStats[selected]++;
			} else {
				MStats[selected] = 0;
			}
		}
		if(e.getKeyCode() == KeyEvent.VK_INSERT){
			
		}
		
	}

	@override
	public void keyReleased(KeyEvent e) {
		
	}

	@override
	public void keyTyped(KeyEvent e) {
		
	}
}
Frame.java
Code:
import javax.swing.JFrame;

public class Frame {

	public static void main(String args[]){
		
		int FWidth = 800;
		int FHeight = 600;
		
		JFrame frame = new JFrame("Menu");
		
		frame.setIgnoreRepaint(true);
		frame.setBounds(0, 0, FWidth, FHeight);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		Menu menu = new Menu();
		
		frame.add(menu);
		
		frame.setVisible(true);
	}
}
you can compile it yourself (i doesnt feel liek uplaoding at and virus scans and crap)

do w/e u want with it, i dont care!

havz fahn!
#1 · 15y ago
unspeakable
unspeakable
What a wonder no one compiled your code, or it seems so, anyway.

---------- Post added at 05:53 PM ---------- Previous post was at 05:52 PM ----------

especially if your location is in your readers mum's bed.
#2 · 14y ago
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Tags for this Thread

None