Hi,
I need help to automate my code to take data from input file. Also I need to create it as a function so that I can pass it to some other program. I am new to Java so having a bit limitation to do this.
My tab delimited Input File looks like this:-
21 p 13e 0 62 1 580001 andrew -14.53 -13.95 0 0
21 p 13d 63 124 580002 1160001 andrew -13.95 -13.37 0 0
21 p 12g 311 364 2900000 3385714 john -11.63 -11.14 0 0
21 q 11.1a 1274 1321 12300000 12750000 peter -2.23 -1.78 0 0
My program code has to store this data like this:- -
g.drawRect(0,60,62,27);
-
g.setColor(Color.black);
-
g.fillRect(0,60,62,27);
-
g.drawRect(63,60,61,27);
-
g.setColor(Color.gray);
-
g.fillRect(63,60,61,27);
but curretly I am manually entering this data. I am reading the 4rth and 5th field in my tab delimited input file and taking the difference of 4rth and 5th field as my 3rd value. Suppose in (0,60,62,27) my 3 value 62 is 0 - 62 etc. My 60 and 27 are almost constant for the whole data in (0,60,62,27) except for my highlighter for loop below.
Now one more important thing. I have created a special rectangle in my for loop which has to do the following:-
1) If a user enters any value between 580001 - 1160001 from command line which is from 6th and 7th fields in input file my for loop below should highlight that area in the rectangles, i.e, 63 to 124 which is it should set(63,60,61,27) values for my for loop. Suppose:- -
int thickness = 5;
-
g.setColor(Color.red);
-
for (int i = 0; i < thickness; i++)
-
g.draw3DRect(63 - i, 60 - i, 61 2 i, 27 2 i, true);
This should highlight the second rectangular block.
Also whenever there is suppose andrew in the line print black in my g.setColor(Color.black) for that line / suppose john print gray in my g.setColor(Color.black).
Currently my code looks like this:- -
import java.awt.;
-
import javax.swing.;
-
import java.awt.Color;
-
import java.awt.event.WindowAdapter;
-
import java.awt.event.WindowEvent;
-
import javax.swing.JFrame;
-
-
public class Myprogram extends JPanel {
-
public void paintComponent(Graphics g) {
-
super.paintComponent(g);
-
-
g.drawRect(0,60,62,27);
-
g.setColor(Color.black);
-
g.fillRect(0,60,62,27);
-
g.drawRect(63,60,61,27);
-
g.setColor(Color.gray);
-
g.fillRect(63,60,61,27);
-
g.drawRect(125,60,61,27);
-
g.setColor(Color.gray);
-
g.fillRect(125,60,61,27);
-
-
int thickness = 5;
-
g.setColor(Color.red);
-
for (int i = 0; i < thickness; i++)
-
g.draw3DRect(63 - i, 60 - i, 61 2 i, 27 2 i, true);
-
-
}
-
-
public static void main(String[] args) {
-
JFrame frame = new JFrame();
-
frame.setTitle("My Java program");
-
frame.setSize(1000, 200);
-
frame.addWindowListener(new WindowAdapter() {
-
public void windowClosing(WindowEvent e) {
-
System.exit(0);
-
}
-
});
-
Container contentPane = frame.getContentPane();
-
contentPane.add(new Myprogram());
-
-
frame.show();
-
}
-
-
}
20 3700
Encapsulate all that logic (all the rules) into a nice class. The class represents a line from the text file. Here is an implementation of the color rules -
class MyClass {
-
String line;
-
-
MyClass(String lineFromFile) {
-
line = lineFromFile;
-
}
-
-
public Color getColor() {
-
if (line.contains("andrew")) {
-
return Color.BLACK;
-
} else if (line.contains("john")) {
-
return Color.GRAY;
-
} else {
-
//what should you return here?
-
}
-
}
-
-
}
-
Good idea :)
Thanks
cowboy
Hi can anybody help me to correct errors in this code. I have written where I am having problems inside the code. I have reached this far doing this code:- - import java.io.*;
-
import java.awt.*;
-
import javax.swing.*;
-
import java.awt.Color;
-
import javax.swing.JFrame;
-
import java.util.ArrayList;
-
import java.io.BufferedReader;
-
import java.util.HashMap;
-
import java.awt.geom.Rectangle2D;
-
-
-
public class myProgram extends JPanel {
-
-
private ArrayList<LineInfo> lines;
-
private HashMap<String,Color> hm = new HashMap<String,Color>();
-
private final String fileName = "file.txt";
-
-
public myProgram(){
-
lines = new ArrayList<LineInfo>();
-
this.setPreferredSize(new Dimension(400,400));
-
JFrame frame = new JFrame("FillRect");
-
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
frame.pack();
-
frame.setVisible(true);
-
}
-
public void populateHashMap(){
-
Color red = Color.RED;
-
Color blue = Color.BLUE;
-
hm.put("Andrew",red);
-
hm.put("david",blue);
-
//hm.put("john",Color.Black);
-
//hm.put("peter",Color.White);
-
//hm.put("harry",Color.Gray);
-
}
-
-
@Override
-
public void paintComponent(Graphics g) {
-
super.paintComponent(g);
-
Graphics2D g2d = (Graphics2D) g;
-
g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-
for(int i = 0;i<lines.size();i++){
-
g2d.setColor(lines.get(i).getColor());
-
g2d.fill(lines.get(i).getRect());
-
}
-
-
}
-
-
public void readFile()throws Exception {
-
String n = null;
-
try{
-
BufferedReader fh = new BufferedReader(new FileReader(fileName));
-
while(true){
-
n = fh.readLine();
-
if(n == null){
-
break;
-
}else{
-
System.out.println(n); //testing
-
String[] args = n.split("\t");
-
//Here I want to create new Rectangle here called say tempRect
-
//get color by using Color color = (Color)hm.get(args[x]); where x is the name index
-
//create bew LineInfo object LineInfo tempLineInfo = new LineInfo(tempRect,color);
-
//add to arraylist lines.add(tempLineInfo);
-
}//end of else
-
}//end while
-
fh.close();
-
}catch (FileNotFoundException e1) {
-
System.err.println("File not found: ");
-
}
-
}
-
-
-
public static void main (String[] args){
-
myProgram test = new myProgram();
-
test.populateHashMap();
-
try{
-
test.readFile();
-
}catch(Exception e){
-
System.err.println(e);
-
}
-
}
-
}//end of main class
-
-
-
-
class LineInfo{
-
private Rectangle2D.Double rect;
-
private Color color;
-
public LineInfo(Rectangle2D.Double rect, Color c){
-
this.rect = rect;
-
this.color = c;
-
}
-
public Rectangle2D getRect(){
-
return rect;
-
}
-
public Color getColor(){
-
return color;
-
}
-
}//end of class
-
My input file looks like this:- -
1 p 36.33b 0 11 1 1150001 austin 0.0 5.91 2 0.0019
-
1 p 36.33a 12 24 1150002 2300000 harry 5.91 8.75 2 0.0019
-
1 p 36.32c 25 36 2300000 3300000 austin 8.75 11.19 0 0
-
1 p 36.32b 37 49 3300001 4300000 austin 11.19 13.59 3 0.00285
-
1 p 36.32a 50 61 4300001 5300000 peter 13.59 15.97 10 0.00951
-
1 p 36.31b 62 72 5300000 6200000 peter 15.97 18.07 5 0.00476
-
1 p 36.31a 73 82 6200001 7100000 harry 18.07 20.15 8 0.00761
-
1 p 36.23b 83 93 7100000 8050000 austin 20.15 22.32 8 0.00761
-
1 p 36.23a 94 104 8050001 9000000 john 22.32 24.46 4 0.00381
-
1 p 36.22d 105 125 9000000 9825000 harry 24.46 26.3 5 0.00476
-
What errors are you getting? Where are you creating the LineInfo objects and adding them to the ArrayList?
This is my modified code. Please find the error message below:- - import java.io.*;
-
import java.awt.*;
-
import javax.swing.*;
-
import java.awt.Color;
-
import javax.swing.JFrame;
-
import java.util.ArrayList;
-
import java.io.BufferedReader;
-
import java.util.HashMap;
-
import java.awt.geom.Rectangle2D;
-
import java.awt.Rectangle;
-
-
-
public class kalia extends JPanel {
-
-
private ArrayList<LineInfo> lines;
-
private HashMap<String,Color> hm = new HashMap<String,Color>();
-
private final String fileName = "C:/InputFile.txt";
-
-
public kalia(){
-
lines = new ArrayList<LineInfo>();
-
this.setPreferredSize(new Dimension(1000,400));
-
JFrame frame = new JFrame("FillRect");
-
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
frame.pack();
-
frame.setVisible(true);
-
}
-
public void populateHashMap(){
-
Color red = Color.RED;
-
Color blue = Color.BLUE;
-
hm.put("Andrew",red);
-
hm.put("david",blue);
-
//hm.put("john",Color.Black);
-
//hm.put("peter",Color.White);
-
//hm.put("harry",Color.Gray);
-
}
-
-
@Override
-
public void paintComponent(Graphics g) {
-
super.paintComponent(g);
-
Graphics2D g2d = (Graphics2D) g;
-
g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-
for(int i = 0;i<lines.size();i++){
-
g2d.setColor(lines.get(i).getColor());
-
g2d.fill(lines.get(i).getRect());
-
}
-
-
}
-
-
public void readFile()throws Exception {
-
String n = null;
-
ArrayList<LineInfo> rects = new ArrayList<LineInfo>();
-
try{
-
BufferedReader fh = new BufferedReader(new FileReader(fileName));
-
while(true){
-
n = fh.readLine();
-
if(n == null){
-
break;
-
}else{
-
System.out.println(n); //testing
-
String f[] = n.split("\t");
-
-
int iscntop = Integer.parseInt(f[3]);
-
int iscnbot = Integer.parseInt(f[4]);
-
-
int width = iscntop - iscnbot;
-
-
Rectangle tempRect = new Rectangle(iscntop,60,width,27);
-
Color color = (Color)hm.get(n); //where x is the name index
-
LineInfo tempLineInfo = new LineInfo(tempRect,color);
-
lines.add(tempLineInfo);
-
}//end of else
-
}//end while
-
fh.close();
-
}catch (FileNotFoundException e1) {
-
System.err.println("File not found: ");
-
}
-
}
-
-
-
public static void main (String[] args){
-
kalia test = new kalia();
-
test.populateHashMap();
-
try{
-
test.readFile();
-
}catch(Exception e){
-
System.err.println(e);
-
}
-
}
-
}//end of main class
-
-
-
-
class LineInfo{
-
private Rectangle2D.Double rect;
-
private Color color;
-
public LineInfo(Rectangle2D.Double rect, Color c){
-
this.rect = rect;
-
this.color = c;
-
}
-
public Rectangle2D getRect(){
-
return rect;
-
}
-
public Color getColor(){
-
return color;
-
}
-
}//end of class
Error message is this :- -
symbol : constructor LineInfo(java.awt.Rectangle,java.awt.Color)
-
location: class mypackage.LineInfo
-
LineInfo tempLineInfo = new LineInfo(tempRect,color);
-
1 error
-
BUILD FAILED (total time: 1 second)
Read the error message: you don't have a constructor in your LineInfo class that takes a Rectangle and a Color as parameters.
kind regards,
Jos
I have written another program which is doing almost the same thing. It reads the drawrects() method but when it reaches the 2nd and 3rd method it shows null , null. I modified the input file by replacing colours instead on names ..andrew etc... Why is this null coming while reading 2nd and 3rd method. If you will run the program you will come to know what is happening.
Here is my sample input file:- -
1 p 36.33b 0 50 1 1150001 black 0.0 5.91 2 0.0019
-
1 p 36.33a 51 100 1150002 2300000 red 5.91 8.75 2 0.0019
-
1 p 36.32c 100 148 2300000 3300000 white 8.75 11.19 0 0
-
1 p 36.32b 149 196 3300001 4300000 gray 11.19 13.59 3 0.00285
-
1 p 36.32a 197 244 4300001 5300000 black 13.59 15.97 10 0.00951
-
1 p 36.31b 244 294 5300000 6200000 gray 15.97 18.07 5 0.00476
-
1 p 36.31a 295 344 6200001 7100000 blue 18.07 20.15 8 0.00761
-
1 p 36.23b 344 402 7100000 8050000 cyan 20.15 22.32 8 0.00761
-
1 p 36.23a 403 459 8050001 9000000 yellow 22.32 24.46 4 0.00381
-
-
I need help urgently :(
Thanks in advance
Cowboy
This is the basic structure of your cows class: -
class cows {
-
private ArrayList<cows> rects;
-
private ArrayList<cows> colors;
-
private ArrayList<cows> fills;
-
-
public ArrayList<cows> drawrects() {
-
// nothing here assigns an ArrayList to variable 'rects'
-
return rects;
-
}
-
-
public ArrayList<cows> fillrects() {
-
// nothing here assigns an ArrayList to variable 'fills'
-
return fills;
-
}
-
-
public ArrayList<cows> colorrects() {
-
// nothing here assigns an ArrayList to variable 'colors'
-
return colors;
-
}
-
}
-
IMHO, your code is a bit of a mess. Please design first before you want to implement anything.
kind regards,
Jos
I have corrected some of my mistakes which happened while pasting into ur forum and changing names of some methods. Anyway here is the corrected code. Can you now help me to get it right. I need help badly.
Thanks in advance
Cowboy
You still don't assign anything at all to your three member variables, rects, colors and fills. Creating new objects from within your paintComponent() method is a very bad idea too because you don't know when and how many times that method will be called.
kind regards,
Jos
Now my biggest problem is that my Arraylist are returning NULL. Howto deal with this ?? How should I make it return the values instead ? Even though I am trying to do so inside my methods ...??
@cowboyrocks2009
You are not assigning anything in your methods: you create a local variable with the same name and assign a list to that local variable and you return it at the end of the method but you are not using that return value (read: assign the value to your member variables).
kind regards,
Jos
Now my methods and arraylists seem to work perfectly after printing there values inside paintcomponent method.Why arn't any recatngles being drawn ???
Well I think I am drawing by calling my methods which contain the syntex to draw along with the values ..!! If I am not doing so then what should I do ?? What else should I do make it draw ??
@cowboyrocks2009
You are not drawing anything, you are fiddling with a few Strings that look like drawing method calls. How or what do you think will execute those String values? Java can't do magic. Better study the API documentation for the Graphics class before you continue to write code that'll never work. That class can do actual drawing and is passed to your paintComponent method by the Swing event dispatching thread.
kind regards,
Jos
Hi... Ok I have created another program which is off course a simple. It is creating rects but then fails somewhere. Can you help me to identify the problem. - import java.io.*;
-
import java.util.ArrayList;
-
import java.util.Arrays;
-
import java.io.File;
-
import java.io.FileNotFoundException;
-
import java.io.BufferedReader;
-
import java.util.List;
-
import java.awt.*;
-
import javax.swing.*;
-
import java.awt.Color;
-
import java.awt.event.WindowAdapter;
-
import java.awt.event.WindowEvent;
-
import javax.swing.JFrame;
-
import java.awt.geom.Rectangle2D;
-
import java.util.HashMap;
-
import java.awt.Rectangle;
-
/**
-
*
-
* @author cowboy
-
*/
-
class cows {
-
public int iscntop;
-
public int width;
-
public static int f[];
-
-
-
public void drawrects() {
-
String n = null;
-
-
try{
-
BufferedReader fh = new BufferedReader(new FileReader("InputFile.txt"));
-
while(true){
-
n = fh.readLine();
-
if(n == null){
-
break;
-
}else{
-
String f[] = n.split("\t");
-
-
int iscntop = Integer.parseInt(f[3]);
-
int iscnbot = Integer.parseInt(f[4]);
-
-
-
int width = iscnbot - iscntop;
-
-
-
}
-
-
}//end while
-
fh.close();
-
} catch (FileNotFoundException e) {
-
e.printStackTrace();
-
} catch (IOException e2) {
-
e2.printStackTrace();
-
}
-
-
}
-
-
}
-
-
public class cowboy extends JPanel{
-
-
public void paintComponent(Graphics g) {
-
super.paintComponent(g);
-
Graphics2D g2d = (Graphics2D) g;
-
cows xman = new cows();
-
g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-
for(int i=0; i<xman.f.length; i++){
-
g2d.drawRect(xman.iscntop, 60, xman.width, 27);
-
g2d.setColor(Color.YELLOW);
-
g2d.fillRect(xman.iscntop, 60, xman.width, 27);}
-
-
}
-
-
public static void main(String[] args) {
-
JFrame frame = new JFrame();
-
frame.setTitle("FIll My Rects");
-
frame.setSize(1000, 200);
-
frame.addWindowListener(new WindowAdapter() {
-
public void windowClosing(WindowEvent e) {
-
System.exit(0);
-
}
-
});
-
Container contentPane = frame.getContentPane();
-
contentPane.add(new cowboy());
-
-
frame.show();
-
}
-
-
}
-
Thanks in advance
Cowboy
@cowboyrocks2009
You have to be more exact: what does "it fails somewhere else" mean? Does your program compile? If not, what is the compiler's error message? If it compiles, what is the runtime error message? Does your program 'hang'? What was it's last output? We can't do anything with a sloppy remarks "it fails somewhere else" and neither can you.
kind regards,
Jos
It is now compiling as well as popping up the blank output window but lots of paint related runtime errors are coming which I am not able to understand why !!! I have put all the error messages under my program code. Can you plz guide me what they mean ... - import java.io.*;
-
import java.util.ArrayList;
-
import java.util.Arrays;
-
import java.io.File;
-
import java.io.FileNotFoundException;
-
import java.io.BufferedReader;
-
import java.util.List;
-
import java.awt.*;
-
import javax.swing.*;
-
import java.awt.Color;
-
import java.awt.event.WindowAdapter;
-
import java.awt.event.WindowEvent;
-
import javax.swing.JFrame;
-
import java.awt.geom.Rectangle2D;
-
import java.util.HashMap;
-
import java.awt.Rectangle;
-
-
class cows {
-
private Color color;
-
public cows(Color c){
-
this.color = c;
-
}
-
public Color getColor(){
-
return color;
-
}
-
-
}
-
-
-
public class cowboy extends JPanel{
-
private ArrayList<cows> lines;
-
private HashMap<String,Color> hm = new HashMap<String,Color>();
-
public int iscntop;
-
public int width;
-
public String color;
-
public static int f[];
-
-
-
public void drawrects() {
-
String n = null;
-
try{
-
BufferedReader fh = new BufferedReader(new FileReader("InputFile.txt"));
-
while(true){
-
n = fh.readLine();
-
if(n == null){
-
break;
-
}else{
-
String f[] = n.split("\t");
-
int iscntop = Integer.parseInt(f[3]);
-
int iscnbot = Integer.parseInt(f[4]);
-
int width = iscnbot - iscntop;
-
Color color = (Color)hm.get(f[7]);
-
cows tempLineInfo = new cows(color);
-
lines.add(tempLineInfo);
-
//System.out.println(color);
-
}
-
}//end while
-
fh.close();
-
} catch (FileNotFoundException e) {
-
e.printStackTrace();
-
} catch (IOException e2) {
-
e2.printStackTrace();
-
}
-
}
-
public void setColors(){
-
Color red = Color.RED;
-
Color blue = Color.BLUE;
-
Color black = Color.BLACK;
-
Color gray = Color.GRAY;
-
Color yellow = Color.YELLOW;
-
hm.put("andrew",red);
-
hm.put("john",blue);
-
hm.put("peter",black);
-
hm.put("austin",gray);
-
hm.put("harry",yellow);
-
}
-
-
-
public void paintComponent(Graphics g) {
-
super.paintComponent(g);
-
Graphics2D g2d = (Graphics2D) g;
-
-
g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-
-
for(int i=0; i<f.length; i++){
-
g2d.drawRect(iscntop, 60, width, 27);
-
g2d.setColor(lines.get(i).getColor());
-
g2d.fillRect(iscntop, 60, width, 27);
-
}
-
}
-
public static void main(String[] args) {
-
cowboy test = new cowboy();
-
test.populate();
-
JFrame frame = new JFrame();
-
frame.setTitle("My Rects");
-
frame.setSize(1000, 200);
-
frame.addWindowListener(new WindowAdapter() {
-
public void windowClosing(WindowEvent e) {
-
System.exit(0);
-
}
-
});
-
Container contentPane = frame.getContentPane();
-
contentPane.add(new cowboy());
-
frame.show();
-
}
Here are the runtime Errors that I am getting:- - init:
-
deps-jar:
-
compile-single:
-
run-single:
-
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
-
at mypackage.cowboy.paintComponent(cowboy.java:89)
-
at javax.swing.JComponent.paint(JComponent.java:1027)
-
at javax.swing.JComponent.paintChildren(JComponent.java:864)
-
at javax.swing.JComponent.paint(JComponent.java:1036)
-
at javax.swing.JComponent.paintChildren(JComponent.java:864)
-
at javax.swing.JComponent.paint(JComponent.java:1036)
-
at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
-
at javax.swing.JComponent.paintChildren(JComponent.java:864)
-
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5129)
-
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
-
at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
-
at javax.swing.JComponent.paint(JComponent.java:1013)
-
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
-
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
-
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
-
at java.awt.Container.paint(Container.java:1797)
-
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:734)
-
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
-
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
-
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
-
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
-
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
-
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
-
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
-
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
-
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
-
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
-
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
-
BUILD SUCCESSFUL (total time: 2 seconds)
Thanks in advance
Cowboy
@cowboyrocks2009
Well, something equals null and it shouldn't. The JVM discovered this in your paintComponent() method at line 89; I don't know which line is line 89 (you do). Why not print everything on the console in that method before you try to paint anything and see which (member) variable is null? e.g. the first line of your method could be: -
System.out.println("f: "+f);
-
NullpointerExceptions are easy to catch with a couple of print statements.
kind regards,
Jos
ps. next time you have to show us at which line the error occurred. Help us to help you; we are not going to count lines, nor guess. Be more exact.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Darsant |
last post by:
I'm currently reading 1-n number of binary files, each with 3 different
arrays of floats containing about 10,000 values a piece for a total of
about 30,000 values per file.
I'm looking for a way...
|
by: Szaki |
last post by:
I use a BulkLoad to import file.xml to my base MS Server 2000.
To import this xml file I need schema file. Mayby you know how to do this
file mechanicy f.g. mayby somebody have some script in .net...
|
by: sreenulanka |
last post by:
please help me
in my forum i have labels and textareas .iwant to add textarea components dyanamically when i am clicking the button.please help me
import java.awt.*;
import javax.swing.*;...
|
by: oll3i |
last post by:
i want to change the values in two columns
one colum is a combobox and the secons column is editable too
i want to get the value of that second column and the value of combobox
and sent that...
|
by: stevedub |
last post by:
I am having some trouble configuring my array to read from a sequential file, and then calling on that to fill an array of interests. I think I have the class set up to read the file, but when I run...
|
by: eddiewould |
last post by:
Hi, I want to write a custom widget which will act similarly to a JPanel (i.e it can contain other Components), but semantically it's not a kind of JPanel so it shouldn't extend from it.
Here is...
|
by: Akino877 |
last post by:
Hello,
I have a question regarding Java and Swing programming I wonder if I could ask the forum for some help.
I have a JPanel that has a couple of radio buttons and an "OK/Next" button on it. ...
|
by: lilyumestar |
last post by:
I have project I have to do for class. We have to write 4 different .java files.
Project2.java
HouseGUI.java
House.java
HouseSorting.java
I already finish House.java and I need to work on...
|
by: AnuSumesh |
last post by:
Hi,
I want to read the text property of XML file.
My xml file is as follows:
<?xml version="1.0"?>
<Domain_Credentials>
<User> anu </User>
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |