Please help! How to add a combobox on a jtable
Hi, I have seen on google and here many codes to add a combobox in a jtable but none of them seem to work, I need the urgently.
My problem is that I must add a comboBox or a JComboBox to a cell inside a JTable on a predefined column. It means that on the column 2 I must add diferent comboboxes for eac row. How can I do it, please help.
The celleditor is the component shown and the cellrenderer is the first render of a component in the cell and dont have to be the same jcombo box?
The code on ther post does this:?
returning a diferent combobox for all the cells on the column depending on the row selected, but as long as only one cell can be selected at a time it seems to hace different jcomboboxes added a time?
Is there anyway to render any combobox with different values, my program must let the user chose the teacher it want to teach a definen subject, so the combo must have the teacher of a subject loaded on a database, the combos are not constants. I guess I can manage to use the way you showed me, but is there anyway to render a combo just by adding it to a cell! maybe doing changes to the tablemodel or things like that?
Similar Messages
-
Please Help: How to add a Checkbox field to a JTable
Hi,
I am trying to add a checkbox filed to a JTable with DefaultTableModel.
I have tried fro hours. Just Does not work.
Here is my sample code:
DefaultTableModel model = new DefaultTableModel();
JTable table = new JTable(model);
Object[] data;
data = new Object[2];
data[0]= "string"
data[2] = new Boolean(false)
model.addRow(data);
What is missing in here?
Thanks,
Tarayou can do that with the help of DefaultTableModel alone
if u r so determined to use DefaultTableModel u need to have a subclass of it
following sample may satisfy u ...
import javax.swing.*;
import java.awt.*;
import java.beans.*;
import java.awt.event.*;
import javax.swing.table.*;
public class MyTable extends JApplet{
Object o[] = {"Name","Address","city","Vegetarian"};
Object data[][] = {
{"a","a","pune",new Boolean(true)},
{"Alison", "Huml","mumbai",new Boolean(true)}
class model extends DefaultTableModel
model(Object[][] data,Object[] cn)
super(data,cn);
public Class getColumnClass(int i)
return getValueAt(0,i).getClass();
public Object getValueAt(int i,int j)
return data[i][j];
model m = new model(data,o);
JTable t1 = new JTable(m);
public void init()
Container c1 = new Container();
c1 = getContentPane();
c1.add(t1);
TableColumn tc = t1.getColumnModel().getColumn(2);
JComboBox jc = new JComboBox();
jc.addItem("Pune");
jc.addItem("Mumbai");
jc.addItem("Madras");
tc.setCellEditor(new DefaultCellEditor(jc));
bye
Amol -
Plz help: how to Add a lens profile ? (mac)
hello
i am having problems with the lens profile.
i am working with raw images and when i open in phoshop cs6 (on Mac) and click on lens correction
cant detect what lens i m using (is the canon 16-35 mm) it just gives me option from other canon lens but not this one
when i click search online - doesnt work as well.
i even downloaded the Adobe lens profile downlaoder and find the profile for the lens and downloaded it but still doesnt apper in photoshop lens correcton.
when i open the image in lens correction in the info box under the image gives all the correct info what camera and lenses are used !! but why there isnt any lenses avalable to select when tried to edit the image??
please help how to Add a lens profile from Adobe lens profile downlaoder or how to add in anather way canon lenses.
thank youcan anyone help please?
-
want to cahage my peyment method ( i wana do take out my credit card from there) please help how???
You can't change to 'None' until you clear up the previous payment problem. Add a fresh iTunes gift card, or add a credit card, and then once the billing issue clears, you can choose 'None' again.
-
Please help how to execute jfree......
please help how to execute[b] jfree programs
step by step procedure.....
package org.jfree.chart.demo;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPosition;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.CategoryLabelWidthType;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.text.TextBlockAnchor;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RectangleAnchor;
import org.jfree.ui.RefineryUtilities;
import org.jfree.ui.TextAnchor;
import org.jfree.util.Log;
import org.jfree.util.PrintStreamLogTarget;
* A simple demonstration application showing how to create a horizontal 3D bar chart using data
* from a {@link CategoryDataset}.
public class BarChart3DDemo2 extends ApplicationFrame {
// * JFREECHART DEVELOPER GUIDE *
// * The JFreeChart Developer Guide, written by David Gilbert, is available *
// * to purchase from Object Refinery Limited: *
// * http://www.object-refinery.com/jfreechart/guide.html *
// * Sales are used to provide funding for the JFreeChart project - please *
// * support us so that we can continue developing free software. *
* Creates a new demo.
* @param title the frame title.
public BarChart3DDemo2(final String title) {
super(title);
// create the chart...
final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(23.0, "Series 1", "London");
dataset.addValue(14.0, "Series 1", "New York");
dataset.addValue(14.0, "Series 1", "Istanbul");
dataset.addValue(14.0, "Series 1", "Cairo");
dataset.addValue(13.0, "Series 2", "London");
dataset.addValue(19.0, "Series 2", "New York");
dataset.addValue(19.0, "Series 2", "Istanbul");
dataset.addValue(19.0, "Series 2", "Cairo");
dataset.addValue(7.0, "Series 3", "London");
dataset.addValue(9.0, "Series 3", "New York");
dataset.addValue(9.0, "Series 3", "Istanbul");
dataset.addValue(9.0, "Series 3", "Cairo");
final JFreeChart chart = createChart(dataset);
// add the chart to a panel...
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
* Creates a chart.
* @param dataset the dataset.
* @return The chart.
private JFreeChart createChart(final CategoryDataset dataset) {
final JFreeChart chart = ChartFactory.createBarChart3D(
"3D Bar Chart Demo 2", // chart title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.HORIZONTAL, // orientation
true, // include legend
true, // tooltips
false // urls
final CategoryPlot plot = chart.getCategoryPlot();
plot.setForegroundAlpha(1.0f);
// left align the category labels...
final CategoryAxis axis = plot.getDomainAxis();
final CategoryLabelPositions p = axis.getCategoryLabelPositions();
final CategoryLabelPosition left = new CategoryLabelPosition(
RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
TextAnchor.CENTER_LEFT, 0.0,
CategoryLabelWidthType.RANGE, 0.30f
axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
return chart;
* Starting point for the demonstration application.
* @param args ignored.
public static void main(final String[] args) {
Log.getInstance().addTarget(new PrintStreamLogTarget());
final BarChart3DDemo2 demo = new BarChart3DDemo2("3D Bar Chart Demo 2");
demo.pack();
RefineryUtilities.centerFrameOnScreen(demo);
demo.setVisible(true);
}this is the first time i'm trying to execute jfree programs...
regards,
R.Raghavanhere's error message
E:\raghav>javac BarChart3DDemo2.java
BarChart3DDemo2.java:3: cannot find symbol
symbol : class ChartFactory
location: package org.jfree.chart
import org.jfree.chart.ChartFactory;
^
BarChart3DDemo2.java:4: cannot find symbol
symbol : class ChartPanel
location: package org.jfree.chart
import org.jfree.chart.ChartPanel;
^
BarChart3DDemo2.java:5: cannot find symbol
symbol : class JFreeChart
location: package org.jfree.chart
import org.jfree.chart.JFreeChart;
^
BarChart3DDemo2.java:6: package org.jfree.chart.axis does not exist
import org.jfree.chart.axis.CategoryAxis;
^
BarChart3DDemo2.java:7: package org.jfree.chart.axis does not exist
import org.jfree.chart.axis.CategoryLabelPosition;
^
BarChart3DDemo2.java:8: package org.jfree.chart.axis does not exist
import org.jfree.chart.axis.CategoryLabelPositions;
^
BarChart3DDemo2.java:9: package org.jfree.chart.axis does not exist
import org.jfree.chart.axis.CategoryLabelWidthType;
^
BarChart3DDemo2.java:10: package org.jfree.chart.plot does not exist
import org.jfree.chart.plot.CategoryPlot;
^
BarChart3DDemo2.java:11: package org.jfree.chart.plot does not exist
import org.jfree.chart.plot.PlotOrientation;
^
BarChart3DDemo2.java:12: package org.jfree.data.category does not exist
import org.jfree.data.category.CategoryDataset;
^
BarChart3DDemo2.java:13: package org.jfree.data.category does not exist
import org.jfree.data.category.DefaultCategoryDataset;
^
BarChart3DDemo2.java:14: package org.jfree.text does not exist
import org.jfree.text.TextBlockAnchor;
^
BarChart3DDemo2.java:15: package org.jfree.ui does not exist
import org.jfree.ui.ApplicationFrame;
^
BarChart3DDemo2.java:16: package org.jfree.ui does not exist
import org.jfree.ui.RectangleAnchor;
^
BarChart3DDemo2.java:17: package org.jfree.ui does not exist
import org.jfree.ui.RefineryUtilities;
^
BarChart3DDemo2.java:18: package org.jfree.ui does not exist
import org.jfree.ui.TextAnchor;
^
BarChart3DDemo2.java:19: package org.jfree.util does not exist
import org.jfree.util.Log;
^
BarChart3DDemo2.java:20: package org.jfree.util does not exist
import org.jfree.util.PrintStreamLogTarget;
^
BarChart3DDemo2.java:27: cannot find symbol
symbol: class ApplicationFrame
public class BarChart3DDemo2 extends ApplicationFrame {
^
BarChart3DDemo2.java:80: cannot find symbol
symbol : class CategoryDataset
location: class org.jfree.chart.demo.BarChart3DDemo2
private JFreeChart createChart(final CategoryDataset dataset) {
^
BarChart3DDemo2.java:80: cannot find symbol
symbol : class JFreeChart
location: class org.jfree.chart.demo.BarChart3DDemo2
private JFreeChart createChart(final CategoryDataset dataset) {
^
BarChart3DDemo2.java:50: cannot find symbol
symbol : class DefaultCategoryDataset
location: class org.jfree.chart.demo.BarChart3DDemo2
final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
^
BarChart3DDemo2.java:50: cannot find symbol
symbol : class DefaultCategoryDataset
location: class org.jfree.chart.demo.BarChart3DDemo2
final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
^
BarChart3DDemo2.java:64: cannot find symbol
symbol : class JFreeChart
location: class org.jfree.chart.demo.BarChart3DDemo2
final JFreeChart chart = createChart(dataset);
^
BarChart3DDemo2.java:67: cannot find symbol
symbol : class ChartPanel
location: class org.jfree.chart.demo.BarChart3DDemo2
final ChartPanel chartPanel = new ChartPanel(chart);
^
BarChart3DDemo2.java:67: cannot find symbol
symbol : class ChartPanel
location: class org.jfree.chart.demo.BarChart3DDemo2
final ChartPanel chartPanel = new ChartPanel(chart);
^
BarChart3DDemo2.java:82: cannot find symbol
symbol : class JFreeChart
location: class org.jfree.chart.demo.BarChart3DDemo2
final JFreeChart chart = ChartFactory.createBarChart3D(
^
BarChart3DDemo2.java:87: cannot find symbol
symbol : variable PlotOrientation
location: class org.jfree.chart.demo.BarChart3DDemo2
PlotOrientation.HORIZONTAL, // orientation
^
BarChart3DDemo2.java:82: cannot find symbol
symbol : variable ChartFactory
location: class org.jfree.chart.demo.BarChart3DDemo2
final JFreeChart chart = ChartFactory.createBarChart3D(
^
BarChart3DDemo2.java:93: cannot find symbol
symbol : class CategoryPlot
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryPlot plot = chart.getCategoryPlot();
^
BarChart3DDemo2.java:97: cannot find symbol
symbol : class CategoryAxis
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryAxis axis = plot.getDomainAxis();
^
BarChart3DDemo2.java:98: cannot find symbol
symbol : class CategoryLabelPositions
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryLabelPositions p = axis.getCategoryLabelPositions();
^
BarChart3DDemo2.java:100: cannot find symbol
symbol : class CategoryLabelPosition
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryLabelPosition left = new CategoryLabelPosition(
^
BarChart3DDemo2.java:100: cannot find symbol
symbol : class CategoryLabelPosition
location: class org.jfree.chart.demo.BarChart3DDemo2
final CategoryLabelPosition left = new CategoryLabelPosition(
^
BarChart3DDemo2.java:101: cannot find symbol
symbol : variable RectangleAnchor
location: class org.jfree.chart.demo.BarChart3DDemo2
RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
^
BarChart3DDemo2.java:101: cannot find symbol
symbol : variable TextBlockAnchor
location: class org.jfree.chart.demo.BarChart3DDemo2
RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT,
^
BarChart3DDemo2.java:102: cannot find symbol
symbol : variable TextAnchor
location: class org.jfree.chart.demo.BarChart3DDemo2
TextAnchor.CENTER_LEFT, 0.0,
^
BarChart3DDemo2.java:103: cannot find symbol
symbol : variable CategoryLabelWidthType
location: class org.jfree.chart.demo.BarChart3DDemo2
CategoryLabelWidthType.RANGE, 0.30f
^
BarChart3DDemo2.java:105: cannot find symbol
symbol : variable CategoryLabelPositions
location: class org.jfree.chart.demo.BarChart3DDemo2
axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
^
BarChart3DDemo2.java:118: cannot find symbol
symbol : class PrintStreamLogTarget
location: class org.jfree.chart.demo.BarChart3DDemo2
Log.getInstance().addTarget(new PrintStreamLogTarget());
^
BarChart3DDemo2.java:118: cannot find symbol
symbol : variable Log
location: class org.jfree.chart.demo.BarChart3DDemo2
Log.getInstance().addTarget(new PrintStreamLogTarget());
^
BarChart3DDemo2.java:120: cannot find symbol
symbol : method pack()
location: class org.jfree.chart.demo.BarChart3DDemo2
demo.pack();
^
BarChart3DDemo2.java:121: cannot find symbol
symbol : variable RefineryUtilities
location: class org.jfree.chart.demo.BarChart3DDemo2
RefineryUtilities.centerFrameOnScreen(demo);
^
BarChart3DDemo2.java:122: cannot find symbol
symbol : method setVisible(boolean)
location: class org.jfree.chart.demo.BarChart3DDemo2
demo.setVisible(true);
^
44 errors -
Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with 6.0.1(10A523)version. Please help how to solve this problem. Thanks.
Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore. -
Help: How to add a library item to hide the default Window menu
Hi,
In this post: Help: How to add a library item to hide the default Window menu, it described how to create an menu that will hide the default window menu.
I'd like to know if there a way to put this component into library so that others can directly inherit this menu in other FORMS and how to implement it.
JimmyHi,
I found the solution and the post was not properly phrased. There is no need to add menu into library. All we need is to put the compiled menu into Oracle AS and add the menu name the menu module of the given form.
Thanks.
Jimmy -
after updating my Macbook Pro retina display to os x yosemite 10.10.2, the mause and track pad locks, and do not respond especially when using the Mac for a long period, please help, how can I solve this, I do not like feel like in windows, so I paid good money for this mack, I feel calm
Hi Buterem,
I'm sorry to hear you are having issues with your MacBook Pro since your recent Yosemite update. I also apologize, I'm a bit unclear on the exact nature of the issue you are describing. If you are having intermittent but persistent responsiveness issues with your mouse or trackpad, you may want to try using Activity Monitor to see if these incidents correspond to occupied system resources, especially system memory or CPU. You may find the following article helpful:
How to use Activity Monitor - Apple Support
If the entire system hangs or locks up (for example, if the system clock freezes and stops counting up), you may also be experiencing some variety of Kernel Panic. If that is the case, you may also find this article useful:
OS X: When your computer spontaneously restarts or displays "Your computer restarted because of a problem." - Apple Support
Regards,
- Brenden -
i have just updated my old 3GS and now when i am on restore the window is comming up and asking for a password. i have not set up a password for restore, please help how i can restore my date???
capriz wrote:
i have just updated my old 3GS ...
To what... iOS 7 is Not supported on the 3 GS -
Please Help,how do i get my iphone 4 to play all my songs from icloud, it is currently only playing just a smal number of songs from my library which is stored in icloud.
There are a number of OS X apps, many free, that will save your messages, allowing to view and print them.
http://www.softwarebbs.com/wiki/How_to_transfer_SMS_from_iPhone_to_Mac,_backup_i Phone_SMS_message_on_Mac
Google, for other options
Your "other" of 6 GB may include corrupted data or file sytem errors. If after removing the messages there is still >2GB, you will need to restore the phone in iTunes, first using a backup (made after deleting the messages) and if needed as a new iPhone.
iTunes: Restoring iOS software -
I bought a used iphone from a friend and I am not able to use it in Ethiopia. It is carrier blocked. Can you please help how could I unlock my iphone 4?.
Unlikely as you do not meet there requirements for unlocking.
Have your friend the provided the phone contact them. Based on your statements I am concluding he was or still is an AT&T customer, that is one of the requirements of getting the device unlocked. -
Hello,
I forget my passcode please help how can I get my itYou will need to try to restore your iPad from the same computer that you most recently synced to.
Read this: http://support.apple.com/kb/ht1212
If you can't do the restore then you will need to try Recovery Mode.
Read this: http://support.apple.com/kb/ht1808
Follow the instructions very carefully. -
i have windows 8 and I got this error "Adobe Photoshop has stopped working" whenever I start a program. please help. how can I fix this problem? many thanks
Please read these and proceed accordingly:
http://blogs.adobe.com/crawlspace/2012/07/photoshop-basic-troubleshooting-steps-to-fix-mos t-issues.html
http://forums.adobe.com/docs/DOC-2325 -
hi, my daughter hers ipod touch is disabled connect to itunes after say its itunes couldnot connect to the "ipod touch" because its is locked with a passcode please help how to fix connect...i did turn off her ipod touch put usb back on there same in doenot say still ipod is disabled i dont understand please help how???
If You Are Locked Out Or Have Forgotten Your Passcode or Just Need to Restore Your Device
1. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
3. iOS- Understanding passcodes
If you have forgotten your Restrictions code, then follow the instructions
below but DO NOT restore any previous backup. If you do then you will
simply be restoring the old Restrictions code you have forgotten. This
same warning applies if you need to restore a clean system.
A Complete Guide to Restore or Recover Your iDevice (if You Forget Your Passcode)
If you need to restore your device or ff you cannot remember the passcode, then you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and re-sync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone, iPad and iPod touch software.
Try restoring the iOS device if backing up and erasing all content and settings doesn't resolve the issue. Using iTunes to restore iOS devices is part of standard isolation troubleshooting. Restoring your device will delete all data and content, including songs, videos, contacts, photos, and calendar information, and will restore all settings to their factory condition.
Before restoring your iOS device, Apple recommends that you either sync with iTunes to transfer any purchases you have made, or back up new data (data acquired after your last sync). If you have movie rentals on the device, see iTunes Store movie rental usage rights in the United States before restoring.
Follow these steps to restore your device:
1. Verify that you are using the latest version of iTunes before attempting to update.
2. Connect your device to your computer.
3. Select your iPhone, iPad, or iPod touch when it appears in iTunes under Devices.
4. Select the Summary tab.
5. Select the Restore option.
6. When prompted to back up your settings before restoring, select the Back Up
option (see in the image below). If you have just backed up the device, it is not
necessary to create another.
7. Select the Restore option when iTunes prompts you (as long as you've backed up,
you should not have to worry about restoring your iOS device).
8. When the restore process has completed, the device restarts and displays the Apple
logo while starting up:
After a restore, the iOS device displays the "Connect to iTunes" screen. For updating
to iOS 5 or later, follow the steps in the iOS Setup Assistant. For earlier versions of
iOS, keep your device connected until the "Connect to iTunes" screen goes away or
you see "iPhone is activated."
9. The final step is to restore your device from a previous backup. If you do not have a
backup to restore, then restore as New.
If you are restoring to fix a forgotten Restrictions Code or as a New device, then skip Step 9 and restore as New. -
Hi,
Please help
How can I install flash player plugin (version 8) in browser
without
downloading setup or redirecting to macromedia site if flash
plugin is not
available in browser
ThanksVia Javascripting. Look for Flash detection kits at the
Adobe/Maromedia web
site and also at Internet search engines.
As well this forum focuses on database access issues and you
might find more
takers for this type of question in the Flash General forum.
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
"jiby" <[email protected]> wrote in message
news:e3odp2$pdc$[email protected]..
Hi,
Please help
How can I install flash player plugin (version 8) in browser
without
downloading setup or redirecting to macromedia site if flash
plugin is not
available in browser
Thanks
Maybe you are looking for
-
Event won't display in Month View
I put in an event lasting x days and it will display happily in day and week views but not month. Any ideas anyone? Thanks
-
Time Machine getting stuck on random hourly backups?? Please help!
I set up Time Machine the yesterday, it compleated it's initial backup fine, and performed about 10 or so hourly backups, then randomly on one of it's hourly backups it got stuck. It never actually started the backup. The preferences said it was back
-
Printing with overprints in Acrobat X not working-
I have been trying to print PDFs to a laser printer trying to get Overprints to show up as they do in the PDF with the overprint preview on. I ended up opening them in Acrobat 9 and printing to image. This was what I used to do in Acrobat 9 to get th
-
Can't receive any results from TaskManager
I can't receive message from TaskManager when initiate new task. There is always time out. From BPEL Console I've got only this message: "Your test request generated the following exception/fault: java.rmi.RemoteException: No Exception - originate fr
-
Where can I Download iOS 5.1 ???
Where I can Download the New iOS 5.1?? Please inform me. Thank you so lot.