Help with reprinting downloaded text from FTP site onto GUI!

*This has already been posted on the Sun Java Forum, but I need help quickly, so I am cross-posting. Thank you!*

Basically, I have all of the data download from the FTP site but I can't get it to be reprinted to the GUI after the GUI is already opened initially. I'm pretty sure I have to make a new method at the very bottom of the class but I don't know what goes there. If anyone needs to look at the other classes, let me know. By the way, I'm handing this in for my final project in Computer Science tomorrow, so I need help quick!

Posted On: Monday 22nd of October 2012 02:14:51 AM Total Views:  410
View Complete with Replies

Related Messages:

help friends.   (175 Views)
hello friends i have a software which we use to draw the network diagram ... (build completely with swings) at the end when we save the file it saves in XML format the problem is when we again load the file and so some modification.. we are getting errors so i need at software which we can use to buid the diagrams and save diagrams can any give me suggestion in this.. please.........
Need help in JList   (162 Views)
all, I am looking for the code in the JList class that displays the items according to the data found in the model.Can any body help me in this. What I am trying to do is to extend the JList capacity.JList can at most display (2 to the power 32)/2 items at any time because the ListModel getSize method is an int.And since int is singed data type, currently only the positive numbers are used. I am trying to use the negative numbers as well to extend the JList and ListModel capacity. This whole thing might not be of great practical benefit, but it is a challenge between me and someone to do it.
help me out pls it is urgent..   (157 Views)
I have the JOptionpane which is poped up when i click some button in JFRAME and i need the Jframe (which is main application here) should be running if the JOptionPane is there contin. ... on the screen . i want the JFRAME application to be working even though the JOPTION PANE is in the on the SCREEN. and dont want a "thread" creation here... as i know JoptionnPane is blocking the thread till we click ok is any other Dialog box there which will never block the thread pls help me out it is urgent.... bye
help on accessing the component in the tab Pane   (154 Views)
IRC Client problem - kindly check the codes.. Is it possible to display the text in the textfield to the textarea on the focused tab
Eclipse visual editor help   (152 Views)
I am new to eclipse visual editor, wanted to get started. I tried the google for some hands on examples, but could not find anything convincing. Can anyone help me out with some hands on guide/documents for eclipse visual editor to get started.
Trying to use PixelGrabber, Need some help   (150 Views)
heres what i want to do. No matter what window i am in, I want it to give me the pixil color thats right in the middle of my screen. How can i do this with the image parameter I am not doing this on a specific thing so the image parameter has to go but i dont know how to fix that. Heres my code, tell me if this is alright. int[] pixels=new int[1]; PixelGrabber pg = new PixelGrabber((i dont want this parameter ), 640, 512, 10, 10, pixels, 0, 1); public int getRGB(int pixels) { System.out.println(pixels); return 0; }
Need help with setIconImage   (166 Views)
Hi ! I'm trying to replace the default Java cup icon with another icon, but it doesn't seem to be working quite right. The Java cup icon is gone, but my icon is not being displayed, it's blank. Here's three different ways that I've tried this... frame.setIconImage(Toolkit.getDefaultToolkit().getImage("images/DVD.ico"));
Can anyone please help Multi span JTable header   (185 Views)
Everyone, sorry for the subject "URGENT", actually it is really very urgent and i notice no one reply so that is why i change once again excuse me for this. I think i can explain my problem by giving you the link as an example from sun web site. Sun Link I am trying to implement this type of jtabl and jtree combination. So far i have achieve my target. But now i want to add multi span header. i have seen some example also here is the link for those examples Code Guru. Can anyone please help me out it is very urgent, and i am totlay lost now.
Need help with addActionListener   (223 Views)
Hi , I have an array of JButtons, and I don't know how to determine which one was clicked. I know how to do it if each button had a different text (i.e. Ok, Cancel, etc.), but in my case they all have the same exact text (I'm writing a poker game). Here is a sample of my code... public Component createComponents() { JButton discardButtons[]= new JButton[5]; for(int x = 0; x < 5; x++) { discardButtons[x]=new JButton("Discard"); discardButtons[x].setMnemonic(KeyEvent.VK_I); discardButtons[x].addActionListener(this); label.setLabelFor(discardButtons[x]); } } public void actionPerformed(ActionEvent e) { System.out.println("Action Command: " + e.getActionCommand()); System.out.println("Source: " + e.getSource()); }
help me.....   (163 Views)
can i set space Tab in JeditorPaneplease help me with this problem.
Capturing events help   (173 Views)
Im building a visual component where the user can drag node(s) from a palette to a main panel. These nodes can be connected to one another with links that one can create by gliding over the node and dragging it to the node that it needs to be connected to. My problem now is how do I determine which way the arrow is going i.e. what if the user is dragging to the left or right ot top or bottom of the node how can I capture this Thank you all for your time
GUI help   (151 Views)
I am designing my first GUI using the Gridbaglayout. I have a content panels called "Shipping Method" with two radio buttons, Ground and Air Express. i have the two radio buttons spaced out properly. I was wondering how I can get the space between the 'ground' radio button and the border of the content panel to decrease Like there is alot of empty space between the 'Ground' radio button the border surrounding my content panel called "Shipping Method" on both the top and bottom. I tried playing around with the insets, but I could not get it to work. Any help would be appreciated. My code is below (I HAVE to use gridbaglayout) public class TaxCalculation extends JFrame { private javax.swing.JPanel jContentPane = null; private javax.swing.JLabel jLabel = null; private javax.swing.JLabel jLabel1 = null; private javax.swing.JLabel jLabel2 = null; private javax.swing.JTextField jTextField = null; private javax.swing.JTextField jTextField1 = null; private javax.swing.JTextField jTextField2 = null; private javax.swing.JPanel jPanel = null; private javax.swing.JRadioButton jRadioButton = null; private javax.swing.JRadioButton jRadioButton1 = null; private javax.swing.JPanel jPanel1 = null; private javax.swing.JTextField jTextField3 = null; private javax.swing.JButton jButton = null; private javax.swing.JButton jButton1 = null; public static void main(String[] args) { } /** * This is the default constructor */ public TaxCalculation() { super(); initialize(); } /** * This method initializes this * * @return void */ private void initialize() { this.setSize(455, 334); this.setContentPane(getJContentPane()); this.setTitle("Tax Calculation"); } /** * This method initializes jContentPane * * @return javax.swing.JPanel */ private javax.swing.JPanel getJContentPane() { if (jContentPane == null) { jContentPane = new javax.swing.JPanel(); java.awt.GridBagConstraints consGridBagConstraints1 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints2 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints3 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints4 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints5 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints6 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints10 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints7 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints12 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints13 = new java.awt.GridBagConstraints(); consGridBagConstraints13.gridy = 5; consGridBagConstraints13.gridx = 1; consGridBagConstraints13.anchor = java.awt.GridBagConstraints.WEST; consGridBagConstraints13.insets = new java.awt.Insets(5,5,5,5); consGridBagConstraints12.gridy = 5; consGridBagConstraints12.gridx = 0; consGridBagConstraints12.anchor = java.awt.GridBagConstraints.EAST; consGridBagConstraints12.insets = new java.awt.Insets(5,3,5,5); consGridBagConstraints10.fill = java.awt.GridBagConstraints.BOTH; consGridBagConstraints10.weighty = 1.0; consGridBagConstraints10.weightx = 1.0; consGridBagConstraints10.gridy = 4; consGridBagConstraints10.gridx = 0; consGridBagConstraints10.gridwidth = 2; consGridBagConstraints10.insets = new java.awt.Insets(0,3,0,3); consGridBagConstraints6.fill = java.awt.GridBagConstraints.HORIZONTAL; consGridBagConstraints6.weightx = 1.0; consGridBagConstraints6.gridy = 2; consGridBagConstraints6.gridx = 1; consGridBagConstraints6.insets = new java.awt.Insets(5,5,5,3); consGridBagConstraints3.gridy = 2; consGridBagConstraints3.gridx = 0; consGridBagConstraints1.gridy = 0; consGridBagConstraints1.gridx = 0; consGridBagConstraints4.fill = java.awt.GridBagConstraints.HORIZONTAL; consGridBagConstraints4.weightx = 1.0; consGridBagConstraints4.gridy = 0; consGridBagConstraints4.gridx = 1; consGridBagConstraints4.insets = new java.awt.Insets(5,5,5,3); consGridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL; consGridBagConstraints5.weightx = 1.0; consGridBagConstraints5.gridy = 1; consGridBagConstraints5.gridx = 1; consGridBagConstraints5.insets = new java.awt.Insets(5,5,5,3); consGridBagConstraints2.gridy = 1; consGridBagConstraints2.gridx = 0; consGridBagConstraints7.fill = java.awt.GridBagConstraints.BOTH; consGridBagConstraints7.weighty = 1.0; consGridBagConstraints7.weightx = 1.0D; consGridBagConstraints7.gridy = 3; consGridBagConstraints7.gridx = 0; consGridBagConstraints7.insets = new java.awt.Insets(0,3,0,3); consGridBagConstraints7.gridwidth = 2; consGridBagConstraints1.anchor = java.awt.GridBagConstraints.CENTER; consGridBagConstraints1.insets = new java.awt.Insets(0,37,0,0); consGridBagConstraints3.insets = new java.awt.Insets(0,24,0,0); consGridBagConstraints2.insets = new java.awt.Insets(0,45,0,0); jContentPane.setLayout(new java.awt.GridBagLayout()); jContentPane.add(getJLabel(), consGridBagConstraints1); jContentPane.add(getJLabel1(), consGridBagConstraints2); jContentPane.add(getJLabel2(), consGridBagConstraints3); jContentPane.add(getJTextField(), consGridBagConstraints4); jContentPane.add(getJTextField1(), consGridBagConstraints5); jContentPane.add(getJTextField2(), consGridBagConstraints6); jContentPane.add(getJPanel(), consGridBagConstraints7); jContentPane.add(getJPanel1(), consGridBagConstraints10); jContentPane.add(getJButton(), consGridBagConstraints12); jContentPane.add(getJButton1(), consGridBagConstraints13); } return jContentPane; } /** * This method initializes jLabel * * @return javax.swing.JLabel */ private javax.swing.JLabel getJLabel() { if(jLabel == null) { jLabel = new javax.swing.JLabel(); jLabel.setText("State:"); } return jLabel; } /** * This method initializes jLabel1 * * @return javax.swing.JLabel */ private javax.swing.JLabel getJLabel1() { if(jLabel1 == null) { jLabel1 = new javax.swing.JLabel(); jLabel1.setText("City:"); } return jLabel1; } /** * This method initializes jLabel2 * * @return javax.swing.JLabel */ private javax.swing.JLabel getJLabel2() { if(jLabel2 == null) { jLabel2 = new javax.swing.JLabel(); jLabel2.setText("Amount:"); } return jLabel2; } /** * This method initializes jTextField * * @return javax.swing.JTextField */ private javax.swing.JTextField getJTextField() { if(jTextField == null) { jTextField = new javax.swing.JTextField(); } return jTextField; } /** * This method initializes jTextField1 * * @return javax.swing.JTextField */ private javax.swing.JTextField getJTextField1() { if(jTextField1 == null) { jTextField1 = new javax.swing.JTextField(); } return jTextField1; } /** * This method initializes jTextField2 * * @return javax.swing.JTextField */ private javax.swing.JTextField getJTextField2() { if(jTextField2 == null) { jTextField2 = new javax.swing.JTextField(); } return jTextField2; } /** * This method initializes jPanel * * @return javax.swing.JPanel */ private javax.swing.JPanel getJPanel() { if(jPanel == null) { jPanel = new javax.swing.JPanel(); java.awt.GridBagConstraints consGridBagConstraints8 = new java.awt.GridBagConstraints(); java.awt.GridBagConstraints consGridBagConstraints9 = new java.awt.GridBagConstraints(); consGridBagConstraints8.gridy = 0; consGridBagConstraints8.gridx = 0; consGridBagConstraints8.anchor = java.awt.GridBagConstraints.WEST; consGridBagConstraints8.insets = new java.awt.Insets(2,2,2,2); consGridBagConstraints9.gridy = 1; consGridBagConstraints9.gridx = 0; consGridBagConstraints9.anchor = java.awt.GridBagConstraints.WEST; consGridBagConstraints9.insets = new java.awt.Insets(2,2,2,2); jPanel.setLayout(new java.awt.GridBagLayout()); jPanel.add(getJRadioButton(), consGridBagConstraints8); jPanel.add(getJRadioButton1(), consGridBagConstraints9); jPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Shipping Method", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); jPanel.setPreferredSize(new java.awt.Dimension(111,0)); } return jPanel; } /** * This method initializes jRadioButton * * @return javax.swing.JRadioButton */ private javax.swing.JRadioButton getJRadioButton() { if(jRadioButton == null) { jRadioButton = new javax.swing.JRadioButton(); jRadioButton.setText("Ground"); } return jRadioButton; } /** * This method initializes jRadioButton1 * * @return javax.swing.JRadioButton */ private javax.swing.JRadioButton getJRadioButton1() { if(jRadioButton1 == null) { jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton1.setText("Air Express"); } return jRadioButton1; } /** * This method initializes jPanel1 * * @return javax.swing.JPanel */ private javax.swing.JPanel getJPanel1() { if(jPanel1 == null) { jPanel1 = new javax.swing.JPanel(); java.awt.GridBagConstraints consGridBagConstraints11 = new java.awt.GridBagConstraints(); consGridBagConstraints11.fill = java.awt.GridBagConstraints.HORIZONTAL; consGridBagConstraints11.weightx = 1.0; consGridBagConstraints11.gridy = 0; consGridBagConstraints11.gridx = 0; consGridBagConstraints11.insets = new java.awt.Insets(0,2,0,2); consGridBagConstraints11.anchor = java.awt.GridBagConstraints.CENTER; jPanel1.setLayout(new java.awt.GridBagLayout()); jPanel1.add(getJTextField3(), consGridBagConstraints11); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Calculated Tax", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); jPanel1.setPreferredSize(new java.awt.Dimension(24,0)); } return jPanel1; } /** * This method initializes jTextField3 * * @return javax.swing.JTextField */ private javax.swing.JTextField getJTextField3() { if(jTextField3 == null) { jTextField3 = new javax.swing.JTextField(); jTextField3.setEditable(false); } return jTextField3; } /** * This method initializes jButton * * @return javax.swing.JButton */ private javax.swing.JButton getJButton() { if(jButton == null) { jButton = new javax.swing.JButton(); jButton.setText("Clear"); } return jButton; } /** * This method initializes jButton1 * * @return javax.swing.JButton */ private javax.swing.JButton getJButton1() { if(jButton1 == null) { jButton1 = new javax.swing.JButton(); jButton1.setText("Calculate"); } return jButton1; } } // @jve:visual-info decl-index=0 visual-constraint="8,20"
JTree help needed   (161 Views)
help me!!   (154 Views)
Hi: . I do not know why my code can not work please help me!! thanks. import javax.swing.*; import java.awt.event.*; import java.awt.*; public class Test4_main{ Test4 test; public Test4_main(){ test = new Test4(); test.addActionListener(l); } public static void main(String args[]){ new Test4_main(); } ActionListener l = new ActionListener(){ public void actionPerformed(ActionEvent e){ String s = test.get(); System.out.println(s); } }; } import javax.swing.*; import java.awt.event.*; import java.awt.*; public class Test4 extends JFrame{ ActionListener l; TestPanel jp; public Test4(){ super("Test"); jp = new TestPanel(l); buildGUI(); } public void addActionListener(ActionListener l){ this.l =l; } public void buildGUI(){ getContentPane().add(jp); setSize(200,200); setVisible(true); } public String get(){ return jp.get(); } } class TestPanel extends JPanel{ JButton jb; JTextField jt; ActionListener l; public TestPanel(ActionListener l){ this.l = l; jb = new JButton("Button"); jt = new JTextField(10); setLayout(new FlowLayout()); add(jt); jt.setText("World"); add(jb); jb.addActionListener(l); } public String get(){ return jt.getText(); } }
Will swing help me?   (158 Views)
Hi Friends, How do i achieve the exact functinality of MicroSoft Excel using Java Swing.How do i arrive at the solution.If some body has the tip to proceed please let me know. Thanx in advance. thanx Prashu
need java help!   (179 Views)
hello every one, thank you for your answers and suggestions! I have two questions to ask for you: 1: having an java application (JBuilder)where I use a button, how to call an Html page when clicking on this button(in my case I made a web site with FrontPage )so how to call the first page (ie:index)when clicking on the button 2: I have a textField where i input my text, but my contion is that this textField must contain one caractere or more and no blanks!!! I used: code: ---------------------------------------------------------------------------- String s = textFiel1.gettext();if(s.equals(""))System.out.println("error!");else System.out.println("no error"); ---------------------------------------------------------------------------- the problem is when I type the space kEY it considers it as a caracter so the result of the execution is : no error!!! what must I do to recognize this caracter waiting for your help! thanks for you!
I am not able to display panel in my applet by embedding applet in html. Please help.   (185 Views)
I am not able to display panel in my applet by embedding applet in html. Please help. It is displaying draw string "sample applet 9" but the chartpanel is not being displayed. html file: applet code: public void paint(Graphics g) { g.drawString("sample applet 9", 100, 100); XYDataset dataset = createDataset(); JFreeChart chart = createChart(dataset); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); chartPanel.setVisible(true); getContentPane().add(chartPanel); g.dispose(); g.finalize(); g = null; //setVisible(true); } Advance
Java dynamic gui help   (144 Views)
, I posted this question the other day in, but wasn't able to get a good answer, so now I'm asking here... I have a project and I'm working on the important part now. I want to create this interface in the end and informations in DB. This my goal, this is a prototypical interface created with MockupScreens now I created this interface, I think I'm progressing slowly because I made it in one day it needs more work on... This is the ouput: This interface is composed by : - one columnPanel with a GridLayout - a rowPanel which contains the 5 buttons : ( title of row + up + down + delete + add) Now I created the add button but itsn't woks like I want. It adds rowPanel in columnPanel. For example when I click add buttton on row N0 60, the next rowPanel will be in the end of list not just after. I want the new rowPanel appear between N0 60 and N0 13 . I added a random number with number of row to differentiate between rowPanels. Someone have an idea. I tryed to print the index of rowpanel using getComponent() but it always gives 0. int index = 0; rowPanel.getComponent(index);
DefaultTableModel help   (133 Views)
I'm trying to read in data from a file and then display the data in a table. I've just managed to read the data into a string. I printed the data out in the command line just to check it was working and it was. Then I tried to add the DefaultTableModel, but I got a it confused as to what code should be in which method and I can't get my program to compile now. I think the code is all right, I've just got bits of it in the wrong place. import javax.swing.*; import java.awt.*; import javax.swing.table.*; import*; import java.util.*; class AddressBook extends JFrame { DefaultTableModel contactsTable; String line = new String(); public readLine() throws IOException { BufferedReader file_in = new BufferedReader (new FileReader("AddressBook.buab")); ArrayList addresses = new ArrayList(); while (true) { line = file_in.readLine(); if (line == null) break; addresses.add(line); System.out.println(line); } } public AddressBook() { this.setSize(new Dimension(640, 480)); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(0,0,1,1,0.01,1.0, GridBagConstraints.NORTH, GridBagConstraints.NONE, new Insets(0,0,0,0),0,0); JButton search = new JButton("Search"); this.add(search, c); c.gridx++; JButton add = new JButton("Add"); this.add(add, c); c.gridx++; JButton importData = new JButton("Import"); this.add(importData, c); c.gridx++; JButton export = new JButton("Export"); this.add(export, c); c.gridx++; JButton delete = new JButton("Delete"); this.add(delete, c); c.fill = GridBagConstraints.BOTH; c.gridx = 0; c.gridy = 1; c.gridwidth = 5; this.contactsTable = new DefaultTableModel (line, new String[] {"Surname", "First Name", "Home Phone Number", "Mobile number", "Address"}); JTable table = new JTable(this.contactsTable); JScrollPane scrollpane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); this.add(scrollpane, c); this.setVisible(true); } public static void main(String[] args) throws IOException { new AddressBook(); } }
help with .isSelected   (150 Views)
i have a problem with the Jcheckbox listener. i set the initial charge to 10. and for every checkbox selected, the charge should increment to 1. however, decrements to 1 as well when desselected. the problem with my code is that the incrementation and decrementation only works for ONE checkbox. when i the second box is selected, it wont increment the charge neither decrements when unselected. please help import javax.swing.*; import java.awt.*; public class Clinic { public JFrame f; public JLabel l1,l3,l4; public JCheckBox c[]; public JPanel p1,p2,p3,p4; private Events e; private double price = 10.0; public Clinic() { f= new JFrame("Lion Tigers and Bears Clinic"); l1= new JLabel("Lion Tigers and Bears Pet Clinic \n Services"); l3= new JLabel("Service Charge: "); l4= new JLabel(String.valueOf(price)); c[0]= new JCheckBox("Office Visits"); c[1]= new JCheckBox("Vaccination"); c[2]= new JCheckBox("Hospitalization"); c[3]= new JCheckBox("Heartworm Prevention"); c[4]= new JCheckBox("Boarding"); c[5]= new JCheckBox("Dentistry"); c[6]= new JCheckBox("X-Rays"); c[7]= new JCheckBox("Laboratory Work"); c[8]= new JCheckBox("Prescriptions"); p1= new JPanel(); p3= new JPanel(); p4= new JPanel(); e= new Events(this); } public void launch() { for(int i=0;i