35,618 Topics

Member Avatar for
Member Avatar for jhonnyboy

Hey guys im making a simple program. I have a while loop that continues while the bool quit ! = true. I am trying to test that in a statement like this: [CODE] String userdecision = ""; while (quit!=true){ //start while System.out.print("Would you like to continue with another transaction?"); [B]userdecision=in.next();[/B] …

Member Avatar for jhonnyboy
0
141
Member Avatar for vartikachandra

code:: [code] import java.io.*; import java.util.*; public class Global{ public static int flag=0; } interface filebackedfifoqueue { void put(String msg); String get(); } public class trying{ public static void main(String args[])throws IOException{ int ch=1; String msg; msg = new String(); while(ch!=0) { BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); System.out.println("\nMenu"); System.out.println("\n0.EXit"); System.out.println("\n1.Publisher"); System.out.println("\n2.Subscriber"); …

Member Avatar for vartikachandra
0
111
Member Avatar for tanha

Hi everybody, I want to have a login form in Java, which comparing the username and password, according to MySQL database data, so I have the following code, just don't know where to add the select statement and how verify the username and password from MySQL with the JTextfield of …

Member Avatar for peter_budo
0
3K
Member Avatar for puneetkay

Hello Everyone, Few days ago, There was active thread on creating own DBMS in Java. Its not an easy task so i decided to create Object-Relational Mapping Framework and i have done so. I have tested all methods and its working perfectly. Now i have decided to make it available …

Member Avatar for puneetkay
0
173
Member Avatar for Mr.UNOwen

Hello, I'm creating a program that involves coloring an image thats is gray scaled and has a transparent background. How do I do that?

Member Avatar for peter_budo
0
68
Member Avatar for Manutebecker
Member Avatar for Manutebecker
0
111
Member Avatar for gokcer

I am doing a Java project and in my gui I want to use Buttons. I want to put a class' internal parts code as a button action. Because the class Throws Exception when I copy the contents of the class under the button definition I encounter unreported exception error. …

Member Avatar for gokcer
0
131
Member Avatar for hell_tej

hi Frends, I am a NetBeans user, I show an error in My project when i click on Design view of JFrame. Error is:-"The File Formate is Not Recognized" this is my project database's JFrame. i can't see the design view but ican write code in it. In code window. …

Member Avatar for quuba
0
137
Member Avatar for MxDev

hi guys, how to make frames, or windows in a shape of circle or something not in regular rectangular?? Thanks in advance.

Member Avatar for stephen84s
0
31
Member Avatar for leeba

I have two strings s1 and s2. I have to check what is the largest occurence of letters in s2 that are in s1. For example: s1="xyz" s2="abxyryxzycx" it would then return 4 since "yxzy" is the largest substring with all the letters in s1. It has to be recursive. …

Member Avatar for quuba
0
96
Member Avatar for Swapna Gouri

Hi All I've created a web page where I'm trying to pull data from the database. My requirement is to populate a combo box from the database automatically, i.e. as and when the db updates, the combo box needs to get updated. I have heard that it's possible with Ajax. …

Member Avatar for ~s.o.s~
0
101
Member Avatar for barbz
Member Avatar for barbz

[CODE] import java.io.*; import java.util.*; public class Palindrome { public static void main(String[] args) throws IOException { char letter; String reversed,NEW; Stack S = new Stack(); BufferedReader stndin=new BufferedReader(new InputStreamReader(System.in)); System.out.print("Enter a word: "); String word=stndin.readLine(); for(int i=0; i<word.length(); i++){ letter = word.charAt(i); //this line should cut the 1st letter …

Member Avatar for barbz
0
177
Member Avatar for tuse

Hi! I am trying to initiate a client-server talk but for some reason it is not working. The server starts running, but when I start the client nothing happens. Please point out the mistake in my code- Server- [code="java"] import java.io.*; import java.net.*; public class MyServer { public static void …

Member Avatar for tuse
0
112
Member Avatar for blackrobe

I have a Set that contains different random lines from a text file, now I'm new to Java so I don't know much about the methods available but I have tried using the java.util.Set.toArray() method but it returns an Object[] than can not be sorted. Is there anyway to do …

Member Avatar for quuba
0
149
Member Avatar for 3pid

hey! I`m a beginner in Java and I want to write a program that use try and catch method to send a msg if the average it calculate is not in [0-20] I have already write this code but it always print 0! what is wrong with my code?!!! [ICODE]using …

Member Avatar for 3pid
0
99
Member Avatar for Alishaikh

I made this applet for my APCOMPSCIA class, it due tomorrow but I cant get it working. I need to show the animation of a sort, but it just does sort once that it, please help. I will be very great full. [CODE]import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.util.Random; …

Member Avatar for stephen84s
0
90
Member Avatar for britto

can anyone tell me the code how to create a textpane with scrollbars inside a tabbed pane.....and i should save the text in a file on button click....

Member Avatar for britto
0
590
Member Avatar for faisaly
Member Avatar for ciarz3r

[code=java] import java.util.Scanner; import java.util.regex.*; import java.io.*; import javax.swing.*; /** * A program that parses a user-supplied URL */ public class URLParser { public static void main(String[] args) throws IOException { Scanner scan = new Scanner(System.in); PrintWriter out = new PrintWriter(new FileWriter("D:\\cs2200\\lab8\\URLs.txt")); String input=""; // Everything works the way I …

Member Avatar for stephen84s
0
110
Member Avatar for AllenB

Hello, I am creating a client/server application that verifies math equations for addition, subtraction, and division. I think I just need someone else’s eyes to possibly see where I am going wrong with this. Everything seems to be working fine except for one variable. This is the String serverAnswer variable …

Member Avatar for AllenB
0
137
Member Avatar for nellyznell

I have all my code for this. I have the code to read a txt file, write a txt file, convert the infix to postfix and evaluate it. I am now just having trouble putting it all together. I need it to read the text from a file convert each …

Member Avatar for nellyznell
0
642
Member Avatar for lordx78

[code=java] import java.awt.EventQueue; import javax.swing.JFrame; public class tatat extends JFrame { private static final long serialVersionUID = 1L; public static void main(String args[]) { EventQueue.invokeLater(new Runnable() { public void run() { try { tatat frame = new tatat(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } public …

Member Avatar for ~s.o.s~
0
81
Member Avatar for denniskhor

[code] import java.io.*; import java.util.*; import java.io.IOException; import java.util.Scanner; public class Lab { public static void main(String[]args) { System.out.println("MAIN MENU"); System.out.println("<1> Bahasa Melayu"); System.out.println("<2> English"); System.out.println("<3> Exit"); System.out.println("Your selection (1,2 or 3)?"); Scanner read = new Scanner (System.in); int selection = read.nextInt(); if(selection == 1) { System.out.println("Hello, apa khabar?"); } …

Member Avatar for ~s.o.s~
0
768
Member Avatar for mabz_jean

Implement a subject scheduler using the topological sorting algorithm. The program shall prompt for an input file containing the subjects in the set and the partial ordering of subjects. A subject in the input file shall be of the form (number, subject) where number is an integer assigned to the …

Member Avatar for javaAddict
0
99
Member Avatar for l_03

[CODE] import javax.swing.*; public class A { public static void main (String args[]){ String ask = JOptionPane.showInputDialog("Enter"); if(ask.equals("hello")){ System.out.println("ok."); main(args); }else if(isRepeat(ask)){ System.out.println("Invalid,string has been repeated."); System.exit(0); } } public static boolean isRepeat(String ask){ if(ask.equals("hello")){ return true; }else{ return false; } } } [/CODE] Hello, I am having problems with …

Member Avatar for ahihihi...
0
174
Member Avatar for starsinthesky

i cant figure out what's wrong with my code. can anyone help me pls? [code] import javax.swing.*; import java.awt.*; import java.awt.event.*; public class MyGUI implements WindowListener, ActionListener { public void windowClosing(WindowEvent e) { System.exit(0); } public void windowClosed(WindowEvent e) { } public void windowIconified(WindowEvent e) { } public void windowOpened(WindowEvent …

Member Avatar for starsinthesky
0
111
Member Avatar for ezkonekgal

In a queue, where elements in integers are added, how do i do this: Inside the queue: 1 2 3 5 6 8 when I want to add a number, say 4, the output should be like: 1 2 3 [B]4[/B] 5 6 8 in which it inserts in between …

Member Avatar for ezkonekgal
0
155
Member Avatar for llemes4011

Hi, I'm trying to program Tetris. The thing is, I can't seem to get the Keylistener to work in the JApplet, and I have no idea why :( Here's my code: [CODE=java] import java.util.Random; import java.awt.event.*; import java.awt.*; import javax.swing.*; /** * Class Tetris - write a description of the …

Member Avatar for llemes4011
0
322
Member Avatar for llemes4011

Hi, I'm working on an algorithm that solves a maze from the inside, and seeks out 1 of the 4 exits on the sides, and after getting 1, it goes to the next until it has them all. The maze is always 22x22, and you only have 400 steps. I …

Member Avatar for llemes4011
0
177

The End.