<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Java Programming Forums - The Java Community - AWT / Java Swing</title>
		<link>http://www.javaprogrammingforums.com/</link>
		<description>Graphical User Interface APIs.</description>
		<language>en</language>
		<lastBuildDate>Tue, 21 May 2013 14:19:16 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.javaprogrammingforums.com/images/misc/rss.png</url>
			<title>Java Programming Forums - The Java Community - AWT / Java Swing</title>
			<link>http://www.javaprogrammingforums.com/</link>
		</image>
		<item>
			<title>Progress bar</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29544-progress-bar.html</link>
			<pubDate>Mon, 20 May 2013 01:29:45 GMT</pubDate>
			<description>Hi, i have a really simple question.  
Can someone tell me where to start when i want to add a progress bar. I have an arraylist of string. when i do...</description>
			<content:encoded><![CDATA[<div>Hi, i have a really simple question. <br />
Can someone tell me where to start when i want to add a progress bar. I have an arraylist of string. when i do a for:each loop, inside the loop i have a method that does something with each object<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">for (String ipString : ipAddress.arrListOfIpAddress) { 
&nbsp;
           if (ipAddress.getHostReachable(ipString)) {
              modelIPAddressListModel.addElement(ipString + &quot; is reachable&quot;);                             
           }
}</pre></div></code><hr />
</div> <br />
.How do i put in a progress bar that every time it get's the next item, the progress bar increments by one until it finishes and display's some kind of a message saying finished.</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>tardis_</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29544-progress-bar.html</guid>
		</item>
		<item>
			<title>Layout problems</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29512-layout-problems.html</link>
			<pubDate>Fri, 17 May 2013 16:37:01 GMT</pubDate>
			<description>Hi! 
 
I have often problems with Layouts. How can I set component at exact location.  
I thought I can do 
button.setLocation(20,40) but some...</description>
			<content:encoded><![CDATA[<div>Hi!<br />
<br />
I have often problems with Layouts. How can I set component at exact location. <br />
I thought I can do<br />
button.setLocation(20,40) but some strange things happens all the time. The problem is with this<br />
Layouts (Flow, Grid, Border...). In C# I think there are not these problems.<br />
Can I turn off all these layouts and put things much simpler. At this time I have this code and when I run this<br />
the table is not showed at window?<br />
<br />
public class nothing extends JFrame {<br />
<br />
    private JTable tabpredmet;<br />
<br />
    public nothing () {<br />
        super(&quot;govno&quot;);<br />
        setLayout(null);<br />
        setSize(400, 700);<br />
        setVisible(true);<br />
<br />
        String[][] data = new String[][]{{&quot;Srpski jezik&quot;}, {&quot;Engleski jezik&quot;}, {&quot;Ruski jezik&quot;}};<br />
        String[] col = {&quot;Predmet&quot;};<br />
        tabpredmet = new JTable(data, col);<br />
        tabpredmet.setPreferredScrollableViewportSize(new Dimension(200, 200));<br />
        tabpredmet.setFillsViewportHeight(true);<br />
        // JScrollPane jscrollpane = new JScrollPane(tabpredmet);<br />
        JScrollPane p = new JScrollPane(tabpredmet);<br />
        add(p);<br />
        p.setVisible(true);<br />
        p.setLocation(50, 50);<br />
<br />
    }<br />
<br />
    public static void main(String[] args) {<br />
        nothing a = new nothing ();<br />
        a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);   <br />
<br />
<br />
<br />
<br />
    }<br />
}</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>lijepdan</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29512-layout-problems.html</guid>
		</item>
		<item>
			<title>Incremental graphics painting in applet</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29444-incremental-graphics-painting-applet.html</link>
			<pubDate>Mon, 13 May 2013 21:05:43 GMT</pubDate>
			<description>I have been doing graphics drawing in Eclipse using Applet abstract class and paint() method. Everything works fine except for one situation. On a...</description>
			<content:encoded><![CDATA[<div>I have been doing graphics drawing in Eclipse using Applet abstract class and paint() method. Everything works fine except for one situation. On a mouse click I draw a graphics object. On a different mouse click I redraw  the same object at a different location via a call to repaint() in mouse click event method. So far, so good. But I can't figure out how to keep each prior painted object on the screen after each new mouse click. It seems repaint() clears the screen. In researching the repaint() method there doesn't seem to be a crisp explanation of how to do incremental painting other than manually keeping track of each drawing object in an array list and then redrawing from that on the call to repaint(). That seems awfully burdensome. I can't believe that's the only way. Any ideas?</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>Hobokenrich</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29444-incremental-graphics-painting-applet.html</guid>
		</item>
		<item>
			<title>how can i make a jbutton to close a jframe??</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29410-how-can-i-make-jbutton-close-jframe.html</link>
			<pubDate>Sun, 12 May 2013 12:48:12 GMT</pubDate>
			<description>y0 guys i have been working on a jframe with background and jbuttons and i fixed everything of it 
but the thing that i want to make the exit button...</description>
			<content:encoded><![CDATA[<div>y0 guys i have been working on a jframe with background and jbuttons and i fixed everything of it<br />
but the thing that i want to make the exit button i made to close the jframe when i click on it??<br />
any way how to add that ??<br />
hope somone can help me out!<br />
im a new beginner so.</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>FastFuture</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29410-how-can-i-make-jbutton-close-jframe.html</guid>
		</item>
		<item>
			<title><![CDATA[exchanging 2 Label locations with MouseListener and MouseMotionListen (Drag & Drop)]]></title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29373-exchanging-2-label-locations-mouselistener-mousemotionlisten-drag-drop.html</link>
			<pubDate>Thu, 09 May 2013 19:16:52 GMT</pubDate>
			<description>i have tried to make a Drag and Drop for type of Puzzle. Its my school project and im the only one who is stuck with this trouble ... 
 
 
it doesnt...</description>
			<content:encoded><![CDATA[<div>i have tried to make a Drag and Drop for type of Puzzle. Its my school project and im the only one who is stuck with this trouble ...<br />
<br />
<br />
it doesnt exchange me the Location of the Labels .. with MouseListener ...<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">package proveproject;
import javax.swing.*;
import java.awt.*;;
import java.io.*;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.*;
&nbsp;
public class DPuzzle implements ActionListener{
    JFrame dpFrame;
    JLabel &#91;&#93;lbl;
    JLabel &#91;&#93;eastLbl;
    JButton solve;
    JComponent a,b;
    int X1,Y1,X2,Y2;
&nbsp;
&nbsp;
    DPuzzle(){
        dpFrame = new JFrame(&quot;PUZZLE&quot;);
        dpFrame.setDefaultCloseOperation(dpFrame.EXIT_ON_CLOSE);
        dpFrame.setBounds(50,50,1200,500);
        dpFrame.setLayout(new BorderLayout());
&nbsp;
&nbsp;
        JPanel centerPane = new JPanel();
        centerPane.setLayout(new GridLayout(3,8,3,3));
        JPanel southPane = new JPanel();
&nbsp;
&nbsp;
        //Aggiungo  le immagini
        ImageIcon &#91;&#93;img;
        img = new ImageIcon&#91;9&#93;;
        img&#91;0&#93; = new ImageIcon(&quot;1.jpg&quot;);
        img&#91;1&#93; = new ImageIcon(&quot;2.jpg&quot;);
        img&#91;2&#93; = new ImageIcon(&quot;3.jpg&quot;);
        img&#91;3&#93; = new ImageIcon(&quot;4.jpg&quot;);
        img&#91;4&#93; = new ImageIcon(&quot;5.jpg&quot;);
        img&#91;5&#93; = new ImageIcon(&quot;6.jpg&quot;);
        img&#91;6&#93; = new ImageIcon(&quot;7.jpg&quot;);
        img&#91;7&#93; = new ImageIcon(&quot;8.jpg&quot;);
        img&#91;8&#93; = new ImageIcon(&quot;9.jpg&quot;); 
&nbsp;
&nbsp;
        //metto le immagini nelle label
        lbl = new JLabel&#91;9&#93;;
        for (int i = 0; i &lt; 9; i++) {
            lbl&#91;i&#93;= new JLabel(&quot;&quot;);
            lbl&#91;i&#93;.addMouseMotionListener(new DragMouseAdapter());
            lbl&#91;i&#93;.addMouseListener(new DragMouseAdapter());
        }
&nbsp;
&nbsp;
        lbl&#91;0&#93;.setIcon(img&#91;7&#93;);
        lbl&#91;1&#93;.setIcon(img&#91;4&#93;);
        lbl&#91;2&#93;.setIcon(img&#91;1&#93;);
        lbl&#91;3&#93;.setIcon(img&#91;3&#93;);
        lbl&#91;4&#93;.setIcon(img&#91;6&#93;);
        lbl&#91;5&#93;.setIcon(img&#91;2&#93;);
        lbl&#91;6&#93;.setIcon(img&#91;8&#93;);
        lbl&#91;7&#93;.setIcon(img&#91;5&#93;);
        lbl&#91;8&#93;.setIcon(img&#91;0&#93;);
&nbsp;
&nbsp;
&nbsp;
        //Finisco di mettere le label nel WestPane
&nbsp;
&nbsp;
        //Inizio mettere le immagini nelle Label East 
        ImageIcon whiteImg = new ImageIcon(&quot;whiteImg.jpg&quot;);
        eastLbl = new JLabel&#91;9&#93;;
&nbsp;
&nbsp;
        for (int i = 0; i &lt; 9; i++) {
            eastLbl&#91;i&#93; = new JLabel(&quot;&quot;);
            eastLbl&#91;i&#93;.setIcon(whiteImg);
            eastLbl&#91;i&#93;.addMouseMotionListener(new DragMouseAdapter());
            eastLbl&#91;i&#93;.addMouseListener(new DragMouseAdapter());
        }
&nbsp;
        //Fine Pannello Ovest
&nbsp;
&nbsp;
        //Creare pannello sud 
        solve = new JButton(&quot;Fatto&quot;);
        solve.addActionListener(this);
        southPane.add(solve);
&nbsp;
&nbsp;
&nbsp;
&nbsp;
        centerPane.add(lbl&#91;0&#93;);
        centerPane.add(lbl&#91;1&#93;);
        centerPane.add(lbl&#91;2&#93;);
        centerPane.add(new JLabel(&quot;&quot;));
        centerPane.add(new JLabel(&quot;&quot;));
        centerPane.add(eastLbl&#91;0&#93;);
        centerPane.add(eastLbl&#91;1&#93;);
        centerPane.add(eastLbl&#91;2&#93;);
        centerPane.add(lbl&#91;3&#93;);
        centerPane.add(lbl&#91;4&#93;);
        centerPane.add(lbl&#91;5&#93;);
        centerPane.add(new JLabel(&quot;&quot;));
        centerPane.add(new JLabel(&quot;&quot;));
        centerPane.add(eastLbl&#91;3&#93;);
        centerPane.add(eastLbl&#91;4&#93;);
        centerPane.add(eastLbl&#91;5&#93;);
        centerPane.add(lbl&#91;6&#93;);
        centerPane.add(lbl&#91;7&#93;);
        centerPane.add(lbl&#91;8&#93;);
        centerPane.add(new JLabel(&quot;&quot;));
        centerPane.add(new JLabel(&quot;&quot;));
        centerPane.add(eastLbl&#91;6&#93;);
        centerPane.add(eastLbl&#91;7&#93;);
        centerPane.add(eastLbl&#91;8&#93;);
&nbsp;
&nbsp;
        dpFrame.add(centerPane,BorderLayout.CENTER);
        dpFrame.add(southPane,BorderLayout.SOUTH);
        dpFrame.setVisible(true);
    }
&nbsp;
    @Override
    public void actionPerformed(ActionEvent ae) {
&nbsp;
    }
&nbsp;
    //MouseListener
&nbsp;
&nbsp;
&nbsp;
    //MouseMotionListener
    public class DragMouseAdapter implements MouseMotionListener,MouseListener{
&nbsp;
        @Override
        public void mouseDragged(MouseEvent me) {
            a =(JComponent)me.getSource();
            X1 = a.getX();
            Y1 = a.getY();
        }
&nbsp;
        @Override
        public void mouseMoved(MouseEvent me) {
&nbsp;
        }
&nbsp;
        @Override
        public void mouseClicked(MouseEvent me) {
            a.setLocation(X2, Y2);
            b.setLocation(X1, Y1);
        }
&nbsp;
        @Override
        public void mousePressed(MouseEvent me) {
&nbsp;
        }
        @Override
        public void mouseReleased(MouseEvent me) {
            b = (JComponent)me.getSource();
            X2 = b.getX();
            Y2 = b.getY();
        }
&nbsp;
        @Override
        public void mouseEntered(MouseEvent me) {
            throw new UnsupportedOperationException(&quot;Not supported yet.&quot;);
        }
&nbsp;
        @Override
        public void mouseExited(MouseEvent me) {
            throw new UnsupportedOperationException(&quot;Not supported yet.&quot;);
        }
    }
&nbsp;
&nbsp;
&nbsp;
&nbsp;
    public static void main(String&#91;&#93; args) {
        new DPuzzle();
    }
&nbsp;
}</pre></div></code><hr />
</div> <br />
<br />
<br />
Is there anybody who can help me doing the exchange of the JLabels Location???</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>haiderali</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29373-exchanging-2-label-locations-mouselistener-mousemotionlisten-drag-drop.html</guid>
		</item>
		<item>
			<title>Add MouseClickEvent for a X/Y-Coordinate (JFrame)</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29364-add-mouseclickevent-x-y-coordinate-jframe.html</link>
			<pubDate>Thu, 09 May 2013 13:10:36 GMT</pubDate>
			<description><![CDATA[Hello Everyone 
 
I Google'd for a solution to my problem, but I couldnt find anything :( 
 
I want to add a MouseClickEvent for my GUI, but only for...]]></description>
			<content:encoded><![CDATA[<div>Hello Everyone<br />
<br />
I Google'd for a solution to my problem, but I couldnt find anything :(<br />
<br />
I want to add a MouseClickEvent for my GUI, but only for a small part of my JFrame.<br />
<br />
I made it work with a Invisible Button, but for several reasons I'd like to add the Event in the JFrame.<br />
<br />
Is there a Method with which I can define a range from the X/Y-Coordinates of the JFrame?<br />
<br />
Sorry for my imperfect english :)<br />
<br />
Thx<br />
Student_27</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>Student_27</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29364-add-mouseclickevent-x-y-coordinate-jframe.html</guid>
		</item>
		<item>
			<title>Jradiobutton problem</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29208-jradiobutton-problem.html</link>
			<pubDate>Tue, 07 May 2013 06:58:17 GMT</pubDate>
			<description><![CDATA[I can't seem to get my radio buttons to work. My program basically is a menu. My problem is when i select a burger from my radio buttons and then...]]></description>
			<content:encoded><![CDATA[<div>I can't seem to get my radio buttons to work. My program basically is a menu. My problem is when i select a burger from my radio buttons and then click calcuate it says my subtotal is 200(which I set as default). But since i clicked a button it should be 4.95,5.95,or 6.95. What should I do? Any help is appreciated.<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
&nbsp;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
&nbsp;
&nbsp;
public class DisplayMenu extends JFrame {
	private static JPanel panel;
	private static JPanel panel2;
	private static JPanel panel3;
	private static JPanel orderPanel;
	private static JPanel buttonPanel;
	private JLabel message1;
	private JLabel message2;
	private JLabel message3;
	private JTextField text1;
	private JTextField text2;
	private JTextField text3;
	private JButton calcButton;
	private JButton exitButton;
	private JRadioButton jrb1;
	private JRadioButton jrb2;
	private JRadioButton jrb3;
	private JCheckBox Jchk;
	private JCheckBox Jchk2;
	private JCheckBox Jchk3;
	private JCheckBox Jchk4;
	private JCheckBox Jchk5;
	double BurgerTotal;
	double cond1;
	double cond2;
	double cond3;
	double cond4;
	double cond5;
	double cond6;
	double Subtotal;
	public static void main(String&#91;&#93; args) {
		// TODO Auto-generated method stub
&nbsp;
		 DisplayMenu  frame = new DisplayMenu();
			frame.setTitle (&quot;Hamburger Hamlet Order&quot;);
			frame.setSize (400, 400);
			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			frame.buildPanel();
			frame.add(panel3);
			frame.setVisible(true);
&nbsp;
	}
&nbsp;
	private void buildPanel()
	{
&nbsp;
	panel = new JPanel();
	 jrb1 = new JRadioButton (&quot;burger1(4.95)&quot;);
	  jrb2 = new JRadioButton (&quot;burger2(5.95)&quot;);
	  jrb3 = new JRadioButton (&quot;burger3(6.95)&quot;);
	  Jchk = new JCheckBox(&quot;lettuce&quot;);
	  Jchk2 = new JCheckBox(&quot;onion&quot;);
	  Jchk3 = new JCheckBox(&quot;tomatoes&quot;);
	  Jchk4 = new JCheckBox(&quot;nug&quot;);
	  Jchk5 = new JCheckBox(&quot;byug&quot;);
	ButtonGroup group = new ButtonGroup();
	group.add(jrb1);
	group.add(jrb2);
	group.add(jrb3);
&nbsp;
&nbsp;
if (Jchk.isSelected()){
	cond1 = .25;
}
else{
	cond1= 0;
}
&nbsp;
if (Jchk2.isSelected()){
	cond2 = .25;
}
else{
	cond2 = 0;
}
if (Jchk3.isSelected()){
	cond3 = .25;
}
else{
	cond3= 0;
}
&nbsp;
if (Jchk4.isSelected()){
	cond4 = .25;
}
else{
	cond4 = 0;
}	
if (Jchk5.isSelected()){
	cond5 = .25;
}
else{
	cond5 = 0;
}	
&nbsp;
	add(panel, BorderLayout.WEST); //add the left panel to the border layout
	panel.setLayout (new BoxLayout (panel, BoxLayout.Y_AXIS)); //set the layout of left to box layout
	  //display the buttons on the panel
	calcButton = new JButton (&quot;calculate&quot;);
	exitButton = new JButton (&quot;Exit&quot;);
	panel.add (jrb1);
	panel.add (jrb2);
	panel.add (jrb3);
	if (jrb1.isSelected()){
		BurgerTotal = 4.95;
	}
	else if (jrb2.isSelected()){
		BurgerTotal = 5.95;
	}
	else if (jrb3.isSelected()){
		BurgerTotal = 6.95;
	}
	else{
		BurgerTotal =200;
	}
	calcButton.addActionListener(new CalcButtonListener());
&nbsp;
	exitButton.addActionListener(new ExitButtonListener());
	panel2  = new JPanel();
	panel2.setLayout(new GridLayout(3,2));
	panel2.add (Jchk);
	panel2.add (Jchk2);
	panel2.add (Jchk3);
	panel2.add (Jchk4);
	panel2.add (Jchk5);
	add(panel2, BorderLayout.WEST); //add the left panel to the border layout
	  panel2.setLayout (new BoxLayout (panel2, BoxLayout.Y_AXIS)); //set the layout of left to box layout
	orderPanel = new JPanel();
	orderPanel.setLayout(new GridLayout(3,2));
	message3 = new JLabel (&quot;Subtotal: &quot;);
	orderPanel.add(message3);
	text3 = new JTextField(10);
	text3.setEditable(false);
	orderPanel.add(text3);
	message2 = new JLabel (&quot;Tax(7.85%): &quot;);
	orderPanel.add(message2);
	text2 = new JTextField(10);
	text2.setEditable(false);
	orderPanel.add(text2);
	message1 = new JLabel (&quot;Total due: &quot;);
	text1 = new JTextField(10);
	text1.setEditable(false);
	orderPanel.add(message1);
	orderPanel.add(text1);
	buttonPanel = new JPanel();
	buttonPanel.setLayout(new GridLayout(3,1));
	buttonPanel.add(calcButton);
	buttonPanel.add(exitButton);
	panel3 = new JPanel();
	panel3.setLayout(new GridLayout(2,2));
	panel3.add(panel);
	panel3.add(panel2);
	panel3.add(orderPanel);
	panel3.add(buttonPanel);
&nbsp;
&nbsp;
	}
&nbsp;
	private class CalcButtonListener implements ActionListener
	{
		public void actionPerformed(ActionEvent e)
		{
&nbsp;
			double subtotal;
&nbsp;
			subtotal = BurgerTotal;
			text3.setText(Double.toString(subtotal));	
		}
&nbsp;
	}
	//exits when you click exit
	private class ExitButtonListener implements ActionListener
	{
		public void actionPerformed(ActionEvent e)
		{
			System.exit(ABORT);
		}
&nbsp;
	}
&nbsp;
	}</pre></div></code><hr />
</div> <font color="Silver"><br />
<br />
--- Update ---<br />
<br />
</font>ok i figured that part out I just moved my if statements to the actionlistener</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>wetwater</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29208-jradiobutton-problem.html</guid>
		</item>
		<item>
			<title>How do you change tab stop index in Swing?</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29201-how-do-you-change-tab-stop-index-swing.html</link>
			<pubDate>Tue, 07 May 2013 03:45:33 GMT</pubDate>
			<description>I am sorry for a very simple question, but I am really at loss about this. I am very new with Java, learning it with Murach Java Programming at the...</description>
			<content:encoded><![CDATA[<div>I am sorry for a very simple question, but I am really at loss about this. I am very new with Java, learning it with Murach Java Programming at the moment, with Java 7. What I want to know is, how can I change the order of the focus change when we press the tab key in keyboard? In Visual Basic .NET it is called Tab Index, what is it called in Java? I would love to use Java lingo, but mine is very limited currently.<br />
<br />
Thank you so much.</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>IndraG</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29201-how-do-you-change-tab-stop-index-swing.html</guid>
		</item>
		<item>
			<title>jTextfields and JTables</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29200-jtextfields-jtables.html</link>
			<pubDate>Tue, 07 May 2013 02:21:25 GMT</pubDate>
			<description>Is it possible to populate a J Table when text is entered into a textfield? Reason I ask is I want the data entered in the text fields to be added...</description>
			<content:encoded><![CDATA[<div>Is it possible to populate a J Table when text is entered into a textfield? Reason I ask is I want the data entered in the text fields to be added into the J Table in the same fashion as it is entered. Also I have a combo box that has five titles for my application that I want to be displayed along with the rest if data</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>JoeSmo</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29200-jtextfields-jtables.html</guid>
		</item>
		<item>
			<title>problems with event handlers</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29155-problems-event-handlers.html</link>
			<pubDate>Sat, 04 May 2013 22:07:19 GMT</pubDate>
			<description><![CDATA[I have a GUI project, but the instructions I'm given on what is supposed to happen in each event handler is uncleared. 
For one of them, it is...]]></description>
			<content:encoded><![CDATA[<div>I have a GUI project, but the instructions I'm given on what is supposed to happen in each event handler is uncleared.<br />
For one of them, it is supposed to delete a file made in another event handler. However, I do not know how to delete the file. Can someone help me with this?<br />
For a different event handler, it is supposed to check to make sure all fields are filled in, but I do not know how to write the code to check this. I'm also supposed to store 4 pieces of data to a file on a separate line. However, i don't know how to do this. I have another method, but I don't think I can put a method into a event handler. Can someone help me with this too?</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>my21</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29155-problems-event-handlers.html</guid>
		</item>
		<item>
			<title>Tic Tac Toe Program</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/29001-tic-tac-toe-program.html</link>
			<pubDate>Thu, 02 May 2013 00:47:29 GMT</pubDate>
			<description>Alright, so I have run into a bit of an error and I am not sure where I have gone wrong. I have two sets of code that should work together. The...</description>
			<content:encoded><![CDATA[<div>Alright, so I have run into a bit of an error and I am not sure where I have gone wrong. I have two sets of code that should work together. The problem seems to be in the second file TicTacEvent on line 5. I read something about associating the file, but I do not fully understand what the means or how I am supposed to go about doing that.<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  void b2()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;0&#93;&#91;1&#93;.setIcon(a);
      check&#91;0&#93;&#91;1&#93; = 1; 
    }
    else
    {
      gui.boxes&#91;0&#93;&#91;1&#93;.setIcon(b);
      check&#91;0&#93;&#91;1&#93; = 2;
    }
  }</pre></div></code><hr />
</div> <br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
&nbsp;
public class TicTacEvent implements ItemListener, ActionListener, Runnable
{
  TicTac gui;
  Thread playing;
  ImageIcon a = new ImageIcon(&quot;x.jpg&quot;);
  ImageIcon b = new ImageIcon(&quot;o.jpg&quot;);
  int clicks = 0;
  int win = 0;
  int&#91;&#93;&#91;&#93; check = new int&#91;3&#93;&#91;3&#93;;
&nbsp;
  public TicTacEvent (TicTac in)
  {
    gui = in;
    for (int row=0; row&lt;=2; row++)
    {
      for (int col=0; col&lt;=2; col++)
      {
        check&#91;row&#93;&#91;col&#93;=0;
      }
    }
  }
&nbsp;
  public void actionPerformed (ActionEvent event)
  {
    String command = event.getActionCommand();
&nbsp;
    if (command.equals(&quot;Play&quot;)) 
    {
      startPlaying();
    }
    if (command.equals(&quot;1&quot;)) 
    {
      b1();
    }
    if (command.equals(&quot;2&quot;)) 
    {
      b2();
    }
    if (command.equals(&quot;3&quot;)) 
    {
      b3();
    }
    if (command.equals(&quot;4&quot;)) 
    {
      b4();
    }
    if (command.equals(&quot;5&quot;)) 
    {
      b5();
    }
    if (command.equals(&quot;6&quot;)) 
    {
      b6();
    }
    if (command.equals(&quot;7&quot;)) 
    {
      b7();
    }
    if (command.equals(&quot;8&quot;)) 
    {
      b8();
    }
    if (command.equals(&quot;9&quot;)) 
    {
      b9();
    }
  }
&nbsp;
  void b1()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;0&#93;&#91;0&#93;.setIcon(a);
      check&#91;0&#93;&#91;0&#93; = 1;
    }
    else
    {
      gui.boxes&#91;0&#93;&#91;0&#93;.setIcon(b);
      check&#91;0&#93;&#91;0&#93; = 2;
    }
  }
&nbsp;
  void b2()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;0&#93;&#91;1&#93;.setIcon(a);
      check&#91;0&#93;&#91;1&#93; = 1; 
    }
    else
    {
      gui.boxes&#91;0&#93;&#91;1&#93;.setIcon(b);
      check&#91;0&#93;&#91;1&#93; = 2;
    }
  }
&nbsp;
  void b3()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;0&#93;&#91;2&#93;.setIcon(a);
      check&#91;0&#93;&#91;2&#93; = 1; 
    }
    else
    {
      gui.boxes&#91;0&#93;&#91;2&#93;.setIcon(b);
      check&#91;0&#93;&#91;2&#93; = 2;
    }
  }
&nbsp;
  void b4()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;1&#93;&#91;0&#93;.setIcon(a);
      check&#91;1&#93;&#91;0&#93; = 1; 
    }
    else
    {
      gui.boxes&#91;1&#93;&#91;0&#93;.setIcon(b);
      check&#91;1&#93;&#91;0&#93; = 2;
    }
  }
&nbsp;
  void b5()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;1&#93;&#91;1&#93;.setIcon(a);
      check&#91;1&#93;&#91;1&#93; = 1; 
    }
    else
    {
      gui.boxes&#91;1&#93;&#91;1&#93;.setIcon(b);
      check&#91;1&#93;&#91;1&#93; = 2;
    }
  }
&nbsp;
  void b6()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;1&#93;&#91;2&#93;.setIcon(a);
      check&#91;1&#93;&#91;2&#93; = 1; 
    }
    else
    {
      gui.boxes&#91;1&#93;&#91;2&#93;.setIcon(b);
      check&#91;1&#93;&#91;2&#93; = 2;
    }
  }
&nbsp;
  void b7()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;2&#93;&#91;0&#93;.setIcon(a);
      check&#91;2&#93;&#91;0&#93; = 1; 
    }
    else
    {
      gui.boxes&#91;2&#93;&#91;0&#93;.setIcon(b);
      check&#91;2&#93;&#91;0&#93; = 2;
    }
  }
&nbsp;
  void b8()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;2&#93;&#91;1&#93;.setIcon(a);
      check&#91;2&#93;&#91;1&#93; = 1; 
    }
    else
    {
      gui.boxes&#91;2&#93;&#91;1&#93;.setIcon(b);
      check&#91;2&#93;&#91;1&#93; = 2;
    }
  }
&nbsp;
  void b9()
  {
    clicks = clicks + 1;
    if ((clicks%2)==1)
    {
      gui.boxes&#91;2&#93;&#91;2&#93;.setIcon(a);
      check&#91;2&#93;&#91;2&#93; = 1; 
    }
    else
    {
      gui.boxes&#91;2&#93;&#91;2&#93;.setIcon(b);
      check&#91;2&#93;&#91;2&#93; = 2;
    }
  }
&nbsp;
  void startPlaying()
  {
    playing = new Thread(this);
    playing.start();
    gui.play.setEnabled(false);
  }
}</pre></div></code><hr />
</div> </div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>shodai</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/29001-tic-tac-toe-program.html</guid>
		</item>
		<item>
			<title>Can Anyone Point me in the right direction?</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/28995-can-anyone-point-me-right-direction.html</link>
			<pubDate>Wed, 01 May 2013 20:59:02 GMT</pubDate>
			<description>Doing an assignment for my university course based on an applet guessing game, using random shapes and shapes that are golden. Am i right to use a...</description>
			<content:encoded><![CDATA[<div>Doing an assignment for my university course based on an applet guessing game, using random shapes and shapes that are golden. Am i right to use a case/switch statement for this? I.E. Different cases for random shape and golden ratio shape?</div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>ImyMTD</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/28995-can-anyone-point-me-right-direction.html</guid>
		</item>
		<item>
			<title><![CDATA[I can't use JTable in a JFrameForm despite of import]]></title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/28980-i-cant-use-jtable-jframeform-despite-import.html</link>
			<pubDate>Wed, 01 May 2013 08:11:15 GMT</pubDate>
			<description><![CDATA[Hello everyone, I'm a newbie. I have a question to ask you:confused: 
I'm creating a mini program like following figure: 
Attachment 2060...]]></description>
			<content:encoded><![CDATA[<div>Hello everyone, I'm a newbie. I have a question to ask you:confused:<br />
I'm creating a mini program like following figure:<br />
<a href="http://www.javaprogrammingforums.com/attachments/awt-java-swing/2060d1367395173-i-cant-use-jtable-jframeform-despite-import-8691410223_272d1097c1-jpg"  title="Name:  8691410223_272d1097c1.jpg
Views: 4
Size:  44.8 KB">8691410223_272d1097c1.jpg</a><br />
I have already created 2 above Frames.<br />
When I catch event for Add contact ( in frame Add new contact).<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> private void btnAddContactActionPerformed(java.awt.event.ActionEvent evt) {
        DefaultTableModel tm = (DefaultTableModel)jTable1.getModel();
    }</pre></div></code><hr />
</div> There are a error is underlined at &quot;jTable1&quot;: Netbean has suggested me create class/Field jTable1, but jTable1 has been created in frame &quot;Phone book&quot;. <br />
In my view, I just import the Frame Phone book to Frame Add new contact to use jtable1. Whether it's true? What am I doing wrong? And what's solution?<br />
Thanks for your help(*)</div>


	<div style="padding:10px">

	

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
			<ul>
			<li>
	<img class="inlineimg" src="http://www.javaprogrammingforums.com/images/attach/jpg.gif" alt="File Type: jpg" />
	<a href="http://www.javaprogrammingforums.com/attachments/awt-java-swing/2060d1367395173-i-cant-use-jtable-jframeform-despite-import-8691410223_272d1097c1-jpg">8691410223_272d1097c1.jpg</a> 
(44.8 KB)
</li>
			</ul>
			</fieldset>
	

	

	</div>
]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>trchinh_it</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/28980-i-cant-use-jtable-jframeform-despite-import.html</guid>
		</item>
		<item>
			<title>while looping a swing worker does not display results on jtable?</title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/28978-while-looping-swing-worker-does-not-display-results-jtable.html</link>
			<pubDate>Wed, 01 May 2013 06:36:58 GMT</pubDate>
			<description>hi, 
  I am using swing worker to update my GUI in edt. I have the code below. when I run the code *without* the while loop it works, 
    whereas...</description>
			<content:encoded><![CDATA[<div>hi,<br />
  I am using swing worker to update my GUI in edt. I have the code below. when I run the code <b>without</b> the while loop it works,<br />
    whereas when I run with the while loop it falis , why is it so ?<br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.util.List;
import java.util.Scanner;
import java.util.Vector;
import java.util.concurrent.ExecutionException;
&nbsp;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingWorker;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
&nbsp;
public class App 
{ 	 
	     static JFrame frame = new JFrame(&quot;Random Data Demo&quot;);
	     static JTable table =  new JTable();
	     static DefaultTableModel tableModel = new DefaultTableModel();
	 	 static Scanner sc=new Scanner(System.in);
&nbsp;
	   public static void main(String&#91;&#93; args) throws Exception {
	        EventQueue.invokeLater(new Runnable() {
	            @Override
	            public void run() 
	            {            	
	               while(true)                                                     ////// while loop ---
	               {
&nbsp;
	            	System.out.println(&quot;Write message here: &quot;);									
	     			String message = sc.nextLine();
	     			System.out.println(&quot;Message is: &quot;+message);
&nbsp;
	            	Swingwor mainWorker = new Swingwor(table,message);
	                mainWorker.execute(); 
&nbsp;
	                init();
&nbsp;
	               }
	            }
	        });
	    }
&nbsp;
	   private static void init() {
		   //execTask();
		 // JFrame frame = new JFrame(&quot;Random Data Demo&quot;);
	       frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	      frame.setSize(600,600);
&nbsp;
	    //	DefaultTableModel model = new DefaultTableModel();
	    	//JTable table =  new JTable(model);
	    	table.setModel(tableModel);
&nbsp;
	    	table.repaint();
	    	JScrollPane scrollPane = new JScrollPane(table);
&nbsp;
	    	JPanel panel = new JPanel(new BorderLayout());
	    	//Swingworker mainWorker = new Swingworker(table);
           // mainWorker.execute();
&nbsp;
	    	panel.add(table.getTableHeader(), BorderLayout.PAGE_START);
	    	panel.add(scrollPane, BorderLayout.CENTER);
	    	//getContentPane().add(panel);
              frame.add(panel);
	          frame.setVisible(true);
	    }
&nbsp;
	 //  private static void execTask() 
	  // {	  
		//   Swingwor mainWorker = new Swingwor(table);
	//	   mainWorker.execute(); 
&nbsp;
   //   }
}
&nbsp;
&nbsp;
class Swingwor extends SwingWorker&lt;TableModel,TableModel&gt;
{
&nbsp;
	Object data&#91;&#93;&#91;&#93;=null;
    private final JTable table;
    int i,r;
    String p;
    String message=null;
    Object col&#91;&#93; = {&quot;Sensor&quot;,&quot;Values&quot;,&quot;Arrival_Time&quot;,&quot;Status&quot;,&quot;&quot;};
&nbsp;
    public Swingwor(JTable table, String message) {
        this.table = table;
        this.message = message;
    }    
    @Override
    protected TableModel doInBackground() throws Exception 
    {     	   	
			if(!message.equals(&quot;ITS EMPTY&quot;))
			{
				String&#91;&#93; parts = message.split(&quot;\t&quot;);
		            data = new Object&#91;parts.length / 4&#93;&#91;5&#93;;
				for (i = 0, r = 0; r &lt; data.length; r++) 
				{                        	  						
					data&#91;r&#93;&#91;0&#93; =  parts&#91;i++&#93;;
				   //data&#91;r&#93;&#91;1&#93; =  new Double(parts&#91;i++&#93;) ;
				    data&#91;r&#93;&#91;1&#93; =  parts&#91;i++&#93; ;
				    data&#91;r&#93;&#91;2&#93; = parts&#91;i++&#93;;
				    data&#91;r&#93;&#91;3&#93; = parts&#91;i++&#93;;
				    p=(String) data&#91;r&#93;&#91;3&#93;;
				   // w = (String) abc(p);
				    data&#91;r&#93;&#91;4&#93;=Boolean.parseBoolean(p) ;
				  System.out.println(data&#91;r&#93;&#91;4&#93;);
				}               
				//System.out.println(java.util.Arrays.deepToString(data));
             //Display Table     
                  }
			DefaultTableModel tableModel = new DefaultTableModel(data, col);
	        tableModel.setDataVector(data, col);
			 return tableModel;
          }
&nbsp;
&nbsp;
    @Override
    protected void done() {
        try {
            TableModel model = get();
            table.setModel(model);
        } catch (InterruptedException | ExecutionException ex) {
            ex.printStackTrace();
        }
    }
&nbsp;
&nbsp;
&nbsp;
}</pre></div></code><hr />
</div> </div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>harshilshah</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/28978-while-looping-swing-worker-does-not-display-results-jtable.html</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] How to complete the process( ) for this swingworker ??]]></title>
			<link>http://www.javaprogrammingforums.com/awt-java-swing/28977-how-complete-process-swingworker.html</link>
			<pubDate>Wed, 01 May 2013 06:26:14 GMT</pubDate>
			<description>Hi, 
    I am updating the jtable with the message I enter ... I want to implement a process() for this swing worker ? 
      how do i complete the...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
    I am updating the jtable with the message I enter ... I want to implement a process() for this swing worker ?<br />
      how do i complete the code of process() ?  <br />
<br />
<div class="bbcode_container">
                <div class="bbcode_description">Code :</div>
                <hr /><code class="bbcode_code"><div class="" style="font-family:monospace;"><pre style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.util.List;
import java.util.Scanner;
import java.util.Vector;
import java.util.concurrent.ExecutionException;
&nbsp;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingWorker;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
&nbsp;
public class App 
{ 	 
	     static JFrame frame = new JFrame(&quot;Random Data Demo&quot;);
	     static JTable table =  new JTable();
	     static DefaultTableModel tableModel = new DefaultTableModel();
	 	 static Scanner sc=new Scanner(System.in);
&nbsp;
	   public static void main(String&#91;&#93; args) throws Exception {
	        EventQueue.invokeLater(new Runnable() {
	            @Override
	            public void run() 
	            {            	
	               while(true)
	               {
&nbsp;
	            	System.out.println(&quot;Write message here: &quot;);									
	     			String message = sc.nextLine();
	     			System.out.println(&quot;Message is: &quot;+message);
&nbsp;
	            	Swingwor mainWorker = new Swingwor(table,message);
	                mainWorker.execute(); 
&nbsp;
	                init();
&nbsp;
	               }
	            }
	        });
	    }
&nbsp;
	   private static void init() {
		   //execTask();
		 // JFrame frame = new JFrame(&quot;Random Data Demo&quot;);
	       frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	      frame.setSize(600,600);
&nbsp;
	    //	DefaultTableModel model = new DefaultTableModel();
	    	//JTable table =  new JTable(model);
	    	table.setModel(tableModel);
&nbsp;
	    	table.repaint();
	    	JScrollPane scrollPane = new JScrollPane(table);
&nbsp;
	    	JPanel panel = new JPanel(new BorderLayout());
	    	//Swingworker mainWorker = new Swingworker(table);
           // mainWorker.execute();
&nbsp;
	    	panel.add(table.getTableHeader(), BorderLayout.PAGE_START);
	    	panel.add(scrollPane, BorderLayout.CENTER);
	    	//getContentPane().add(panel);
              frame.add(panel);
	          frame.setVisible(true);
	    }
&nbsp;
	 //  private static void execTask() 
	  // {	  
		//   Swingwor mainWorker = new Swingwor(table);
	//	   mainWorker.execute(); 
&nbsp;
   //   }
}
&nbsp;
&nbsp;
class Swingwor extends SwingWorker&lt;TableModel,TableModel&gt;
{
&nbsp;
	Object data&#91;&#93;&#91;&#93;=null;
    private final JTable table;
    int i,r;
    String p;
    String message=null;
    Object col&#91;&#93; = {&quot;Sensor&quot;,&quot;Values&quot;,&quot;Arrival_Time&quot;,&quot;Status&quot;,&quot;&quot;};
&nbsp;
    public Swingwor(JTable table, String message) {
        this.table = table;
        this.message = message;
    }    
    @Override
    protected TableModel doInBackground() throws Exception 
    {     	   	
			if(!message.equals(&quot;ITS EMPTY&quot;))
			{
				String&#91;&#93; parts = message.split(&quot;\t&quot;);
		            data = new Object&#91;parts.length / 4&#93;&#91;5&#93;;
				for (i = 0, r = 0; r &lt; data.length; r++) 
				{                        	  						
					data&#91;r&#93;&#91;0&#93; =  parts&#91;i++&#93;;
				   //data&#91;r&#93;&#91;1&#93; =  new Double(parts&#91;i++&#93;) ;
				    data&#91;r&#93;&#91;1&#93; =  parts&#91;i++&#93; ;
				    data&#91;r&#93;&#91;2&#93; = parts&#91;i++&#93;;
				    data&#91;r&#93;&#91;3&#93; = parts&#91;i++&#93;;
				    p=(String) data&#91;r&#93;&#91;3&#93;;
				   // w = (String) abc(p);
				    data&#91;r&#93;&#91;4&#93;=Boolean.parseBoolean(p) ;
				  System.out.println(data&#91;r&#93;&#91;4&#93;);
				}               
				//System.out.println(java.util.Arrays.deepToString(data));
             //Display Table     
                  }
		-----&gt;	publish(TableModel);
			DefaultTableModel tableModel = new DefaultTableModel(data, col);
	        tableModel.setDataVector(data, col);
			 return tableModel;
          }
&nbsp;
    @Override
    protected void process(List&lt;TableModel&gt; chunks)
    {
        ///update partial tablemodel
    }
&nbsp;
    @Override
    protected void done() {
        try {
            TableModel model = get();
            table.setModel(model);
        } catch (InterruptedException | ExecutionException ex) {
            ex.printStackTrace();
        }
    }
&nbsp;
&nbsp;
&nbsp;
}</pre></div></code><hr />
</div> </div>

]]></content:encoded>
			<category domain="http://www.javaprogrammingforums.com/awt-java-swing/">AWT / Java Swing</category>
			<dc:creator>harshilshah</dc:creator>
			<guid isPermaLink="true">http://www.javaprogrammingforums.com/awt-java-swing/28977-how-complete-process-swingworker.html</guid>
		</item>
	</channel>
</rss>
