• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need a GUI

 
Pracheth Gandrakota
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hey Guys, I have a bit of a problem,
I need a simple GUI for the following piece of code:


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;


public class wordsearch {
void wordsearchfunc(String fname,String gword)
{
try
{


String cword="",identi="",sample="";
int count = 0;
File f = new File(fname);
Scanner input = new Scanner(f);
while (input.hasNextLine())
{
sample=input.nextLine();
count++;
}
String line = "";
int lineNo;

FileReader fr = new FileReader(fname);
BufferedReader br = new BufferedReader(fr);
for (lineNo = 1; lineNo < count; lineNo++)
{
line = br.readLine();
if(gword.length()<line.length())
{
cword=line.substring(0,gword.length());
identi=line.substring(gword.length(),gword.length()+2);
if (cword.equals(gword)&& identi.equals("||"))
{
System.out.println("Word: "+gword+ "\nNomenclature: "+line.substring(gword.length()+2,line.length()));
}
}
}

}

catch(IOException e)
{
System.out.println(e);
}
}
public static void main(String args[])
{
if(args.length!=2)
{
System.out.println("Enter valid arguments");
System.exit(0);
}
else
{
String fname=args[0];
String gword=args[1];
wordsearch ws= new wordsearch();
ws.wordsearchfunc(fname,gword);
}
}
}
 
Pracheth Gandrakota
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A drop down box thats says select language and submit and cancel buttons
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> I need a simple GUI for the following piece of code:

this is not a drive-through, try rent-a-coder
 
Lalit Mehra
Ranch Hand
Posts: 384
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i agree with michael dunn ...
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pracheth,
Welcome to the Ranch!

Just saying that you need a GUI doesn't help. You need to show us what you have done in the form of an SSCCE.
And remember to use code tags when posting code.
 
Atul Darne
Ranch Hand
Posts: 118
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

You can go for a web project and make a simple JSP page that handles all with text boxes
 
Riaan Nel
Ranch Hand
Posts: 160
IntelliJ IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pracheth Gandrakota wrote:
Hey Guys, I have a bit of a problem,
I need a simple GUI for the following piece of code:


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;


public class wordsearch {
void wordsearchfunc(String fname,String gword)
{
try
{


String cword="",identi="",sample="";
int count = 0;
File f = new File(fname);
Scanner input = new Scanner(f);
while (input.hasNextLine())
{
sample=input.nextLine();
count++;
}
String line = "";
int lineNo;

FileReader fr = new FileReader(fname);
BufferedReader br = new BufferedReader(fr);
for (lineNo = 1; lineNo < count; lineNo++)
{
line = br.readLine();
if(gword.length()<line.length())
{
cword=line.substring(0,gword.length());
identi=line.substring(gword.length(),gword.length()+2);
if (cword.equals(gword)&& identi.equals("||"))
{
System.out.println("Word: "+gword+ "\nNomenclature: "+line.substring(gword.length()+2,line.length()));
}
}
}

}

catch(IOException e)
{
System.out.println(e);
}
}
public static void main(String args[])
{
if(args.length!=2)
{
System.out.println("Enter valid arguments");
System.exit(0);
}
else
{
String fname=args[0];
String gword=args[1];
wordsearch ws= new wordsearch();
ws.wordsearchfunc(fname,gword);
}
}
}

So, what's the problem? I'm guessing that it relates to the fact that I see no GUI code in there.

Swing Tutorial
 
Lalit Mehra
Ranch Hand
Posts: 384
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Riaan Nel >> don't you think you should have started a new thread ???

So, what's the problem? I'm guessing that it relates to the fact that I see no GUI code in there.


yes it does relates to the fact that there's isn't any GUI code ...

try using swing or AWT to build up a small GUI or your app ... you can start with a button and a few textfields

 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Atul Darne wrote:Hi ,

You can go for a web project and make a simple JSP page that handles all with text boxes

I wouldn't consider a JSP page a GUI. The question is about creating a GUI.
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lalit Mehra wrote:@Riaan Nel >> don't you think you should have started a new thread ???

I may be missing something, but what exactly prompted this remark?

Lalit Mehra wrote:try using swing or AWT to build up a small GUI or your app ... you can start with a button and a few textfields

Not AWT, please, it's more than 10 years out of date and is inflexible and clunky. Swing is still the most popular GUI toolkit, and JavaFX 2 is on the way up and will have great advantages once Java SE 8 brings closures to the language.
 
Riaan Nel
Ranch Hand
Posts: 160
IntelliJ IDE Ubuntu VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:
Lalit Mehra wrote:@Riaan Nel >> don't you think you should have started a new thread ???

I may be missing something, but what exactly prompted this remark?


Me too. Lalit, I was implying that the OP should write some GUI code and ask some questions about it, since this is NotACodeMill.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic