Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Swing-AWT How to save data
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


hendra
How to save data
1 Answer(s)      5 years and 11 months ago
Posted in : Swing AWT



Advertisement
View Answers

December 12, 2008 at 1:54 AM


Hi friend,

Code to help in solving the problem :

import javax.swing.*;
import java.awt.event.*;

public class DimensionItemList{
public static void main(String[] args) {
DimensionItemList di = new DimensionItemList();
}

public DimensionItemList(){
String name[] = {"aaa","bbb","ccc","ddd","eee"};
JFrame frame = new JFrame("Setting the Dimensions of an Item in a JList Component");
JPanel panel = new JPanel();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
DefaultListModel model = new DefaultListModel();
for(int i = 0; i < name.length; i++)
model.addElement(name[i]);
JList list = new JList(model){
public String getToolTipText(MouseEvent e) {
int index = locationToIndex(e.getPoint());
if (-1 < index) {
String item = (String)getModel().getElementAt(index);
return item;
} else {
return null;
}
}
};
list.setPrototypeCellValue("RoseIndia.net");
panel.add(list);
frame.add(panel);
frame.setSize(400,400);
frame.setVisible(true);
}
}

For more information on Swing visit to :

http://www.roseindia.net/java/example/java/swing/

Thanks


Related Tutorials/Questions & Answers:
How to save data - Swing AWT
How to save data  Hi, I have a problem about how to save data ,but first before data save to dababase, data must view in jLisit or Jtable... save data from jList and Jtable(in jList or jTable data will be many).Thank's
How to save database data into excelsheet using hibernate
How to save database data into excelsheet using hibernate  How to save database data into excelsheet using hibernate
Advertisements
How can we save a data list in jsf?
How can we save a data list in jsf?  I have a code in jsf that fires a query in Data Base each time it is called, i have added a validation check... it is called again. I tried using save State but it did not help as other functions got
How to save form data to a csv file using jquery or ajax
How to save form data to a csv file using jquery or ajax  Please let me know more about how to do this or please suggest me any sites to learn...) {// code for IE7+, Firefox, Chrome, Opera, Safari data=new
How to save data to excel with a 2.1 work sheet format without changing it?
How to save data to excel with a 2.1 work sheet format without changing it?  hi , i have done a program that allows user to inout data through jtable and save it to excel file then read it again .. the problem is , when data
how to save html form data into .csv file using only jsp.
how to save html form data into .csv file using only jsp.  Dear all, I am developing a website only using jsp and html. i need to save the form data...:\\File.xls"); wb.write(fileOut); fileOut.close(); out.println("Data is saved
save data in excel
save data in excel  hello sir, i'm new to this field i want to know can i save data in excel by html forms input,means if any one fill up form online then it is save offline in excel how can i do it can you give me solution sir
save data in excel
save data in excel  hello sir, i'm new to this field i want to know can i save data in excel by html forms input,means if any one fill up form online then it is save offline in excel how can i do it can you give me solution sir
save data DAO
save data DAO  how to save data in db   package com.tcs.ignite.dao; import com.tcs.ignite.bean.User; import com.tcs.ignite.connection.Connectiondetails; import java.sql.ResultSet; import java.sql.SQLException; import
How to download web page table data, export the table records in an excel file and save
How to download web page table data, export the table records in an excel file and save  i have a web page(.jsp) which contains the table of 4 to 5... be displayed and ask me to save the file. on clicking the save button the data should
How to Validate JRadioButton and How to Save data from JRadioButton to MS Access Database - Java Beginners
How to Validate JRadioButton and How to Save data from JRadioButton to MS Access Database  Hello Sir I want Store Corse Type that contains Two...(3,g); int i=st.executeUpdate(); JOptionPane.showMessageDialog(null,"Data
How to read data from txt file and save to database MySql - Java Beginners
How to read data from txt file and save to database MySql  Please help me again ,my problem right know is how to read data from txt file then data save to database from JButton.Please give me a tutorial and source code
How to save value in JSP
How to save value in JSP  Employee Name Time-IN Time-OUT... 324 2012-12-12 save i want to save dis value jsp to action ...how can i get all value ..and store..how can its values goes
Save the input data until user get changed
Save the input data until user get changed  I would like to know how to store the give input data and perform the calculations even after re-opening... know how to change the fine amount and store for a day by the ADMINISTRATOR
Save the input data until user get changed
Save the input data until user get changed  I would like to know how to store the give input data and perform the calculations even after re-opening... know how to change the fine amount and store for a day by the ADMINISTRATOR
Save the input data until user get changed
Save the input data until user get changed  I would like to know how to store the give input data and perform the calculations even after re-opening... know how to change the fine amount and store for a day by the ADMINISTRATOR
To save table format data in pdf/excel in jsp
To save table format data in pdf/excel in jsp  Hello, I am doing web... table. So my question is ,I want so save this html format data in pdf/excel format... can save html table data in pdf/excel format.Your inputs are valuable to me
How to save image on the server by applet
How to save image on the server by applet  HI, in my project I am... If user want to export this chart as GIF format then this chart should be save as a gif image on the server directory. Can any Body help me how can I do it Thanks
How to save image on the server by applet
How to save image on the server by applet  HI, in my project I am... If user want to export this chart as GIF format then this chart should be save as a gif image on the server directory. Can any Body help me how can I do it Thanks
How to save JPanel as gif or jpeg file
How to save JPanel as gif or jpeg file  i draw polygons , rectangles, lines on jpanel using draw line method drawpolygon methods etc, now i want save the data of jpanel which is drawn by me(lines,polygons) as a gif or jpeg file
save switch data into database - Java Beginners
save switch data into database  switch(menu) { case 1://add a student System.out.print("Enter student ID: "); int ID = scan.nextInt(); System.out.print("Enter your name: "); String name = scan.next(); break
SQLGrammarException while trying to save data in db
SQLGrammarException while trying to save data in db  //hibernate cfg file// <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN
how to save images in oracle using JSP
how to save images in oracle using JSP  how to insert images in oracle using jsp
how to save images in oracle using JSP
how to save images in oracle using JSP  how to insert images in oracle using jsp
how to save a gui form in core java
how to save a gui form in core java  please help me i am java beginner how to save a jframe containing jtable and panels in java thank you
How to save and get value from JSP
How to save and get value from JSP  Employee Name Time... 324 2012-12-12 save i want to save dis value jsp to action ...how can i get all value ..and store..how can its values goes
How to save user interface in flex for design tool
How to save user interface in flex for design tool  Hi I want to create a flex application "sticker design tool" in which i want to save all the caption/logos used with its properties like size,position,textcolor etc.,so when
How to save image after edit in php
How to save image after edit in php  Hello, I have create a simple... successfully but i don't know how to replace orignal image with the effects. please...;body> <form name="form1" action="index.php" enctype="multipart/form-data
How to save JPanel as gif or jpeg file
How to save JPanel as gif or jpeg file  i draw polygons , rectangles, lines on jpanel using draw line method drawpolygon methods etc, now i want save the data of jpanel which is drawn by me(lines,polygons) as a gif or jpeg file
HOW TO SAVE XML INTO MYSQL AND RETRIEVE IT USING JAVA
HOW TO SAVE XML INTO MYSQL AND RETRIEVE IT USING JAVA  H ello, i have an xml code, i need to save it into mysql 5.5 server database using java. i also want to be able to retrieve it as well. please note that i want it saved
how to save uploaded image in database using javascript
how to save uploaded image in database using javascript  Please can you tell me how to store uploaded image in database using java I'll use the upload code as extArray = new Array(".gif", ".jpg", ".png"); function LimitAttach
Advertisements
 

 

 

DMCA.com