JcomboBox + FOR - problem

Hi,
I try changing this code:
ArrayList<String> tmp = new ArrayList<String>();
tmp.add(numbertext.getText());
for(String temp1 : tmp)
System.out.println("a="+temp1.toString());
<b>
Legend:
</b>
numbertext is a JtextField.for JComboBox using FOR but i have error and problems.
String[] items = {"item1", "item2", "item3"};
jComboBox1.setModel(new DefaultComboBoxModel(items));
int num = jComboBox1.getItemCount();
String my = Integer.toString(num);
for (String s : my ) {
        Object item = jComboBox1.getItemAt(num);
        System.out.println("a="+s.toString());I don;t know how to translate for JComoboBox.
Please help

Hmmmm,
I try creating code which I choose in JComoboBox1 value for example Items2 and I click the button. My first value Items2 will be include in string, next I choose value items 4 in JcomboBox and the second value will be in string. Now In string I have a 2 value: items 2 and items 4 And I will have doing choose new value to infinity.
I don't now how to create.

Similar Messages

  • Base Table for problem code in Cs_incidents_all_b

    hi
    in cs_incidents_all_b we have problem_code. the does not contain any data ... we have any tl table for problem code i have cssr_prob_code_mapping_detail but if i query this
    SELECT  dra.repair_number,
      items.description item_desc,
      prob.problem_code,
      fndl.meaning flow_status_name,
      inc.summary,
      nvl(cp.instance_number,'Not availble') ib_instance_number
    FROM csd_repairs dra,
      csd_repair_types_tl drtt,
      cs_incidents_all_b sr,
      csi_item_instances cp,
      fnd_lookups fndl,
      csd_flow_statuses_b fsb,
      mtl_system_items_kfv items,
      mtl_units_of_measure_tl uom,
      jtf_rs_resource_extns_tl rstl,
      jtf_rs_groups_tl rgtl,
      fnd_lookups plkup,
      cs_incidents_all_tl inc,
      cs_sr_prob_code_mapping_detail prob,
      cs_incident_types_b ty
    WHERE dra.repair_type_id       = drtt.repair_type_id
    AND drtt.language              = userenv('LANG')
    AND dra.repair_mode            = 'WIP'
    AND dra.incident_id            = sr.incident_id
    AND dra.CUSTOMER_PRODUCT_ID    = cp.INSTANCE_ID (+)
    AND dra.flow_status_id         = fsb.flow_status_id
    AND fsb.flow_status_code       = fndl.lookup_code
    AND fndl.lookup_type           = 'CSD_REPAIR_FLOW_STATUS'
    AND dra.inventory_item_id      = items.inventory_item_id
    AND dra.unit_of_measure        = uom.uom_code
    AND uom.language               = userenv('LANG')
    AND dra.resource_id            = rstl.resource_id (+)
    AND rstl.category (+)          = 'EMPLOYEE'
    AND rstl.language (+)          = userenv('LANG')
    AND dra.owning_organization_id = rgtl.group_id (+)
    AND rgtl.language (+)          = userenv('LANG')
    AND dra.ro_priority_code       = plkup.lookup_code(+)
    AND plkup.lookup_type(+)       = 'CSD_RO_PRIORITY'
    AND items.organization_id      = cs_std.get_item_valdn_orgzn_id
    AND inc.incident_id            =dra.incident_id
    and ty.incident_type_id=sr.incident_type_id
    and prob.incident_type_id=ty.incident_type_id
    AND fndl.meaning in('Open')
    order by dra.repair_numbereach diffrent problem codes for same repair number here i am want records relevant to Depot Repair

    In 11.5.9, the problem and resolution codes are stored in FND_LOOKUP_VALUES table with lookup type as 'REQUEST_PROBLEM_CODE' and 'REQUEST_RESOLUTION_CODE'. I'm hoping you could still use these tables to find problem codes, even if you were on 11.5.10 or R12.
    Join would be something like:
    WHERE fnd_lookup_values.lookup_type = 'REQUEST_PROBLEM_CODE'
    AND fnd_lookup_values.problem_code = cs_incidents_all_b.problem_code
    Regarding restricting the query for Depot Repair service requests, you need to restrict by the the incident_type_id for this type of SRs (like id for Depot incident type is 10003 for us).
    HTH
    Alka

  • New Context for 'Problems' in Rule modeler not working

    Hi,
    I am using the Rule modeler to determine the Service team based on selected Categorization schema for Incidents - it's working fine. Now I want to implement the same for Problems
    I created a new Z Context (Master Request) to create a rule policy for Problems -> assigned rule policy to a ZServ.Mgr.Profile Unfortunately the rule policy is not working for problems. The new ZContext was copied from existing SERVICEREQUEST context which also copied all the services within.
    Am I missing something ? Please help.
    BR.
    P.S incidents have an action definition with method DISPATCH that determines service team - same has been assigned to Problems.

    Had to use 2 Dispatch methods to determine the service team.

  • Solutions for problems with QuickTime files in After Effects CC (12.0)

    We have a new blog post up about solutions for problems with QuickTime files in After Effects CC (12.0) because of conflict with DVCPROHDVideoOut QuickTime components. 
    Please read that post and let us know here on this forum thread if you have any questions or comments. 
    Also, please let us know if the proposed solution works for you.

    Mark - The new document that we published is meant to address a specific issue. You can confirm you have the issue by the following:
    Adobe QT32 Server is not running when you receive these errors. Keep Activity Monitor open to track whether or not it is running.
    The crash log for QT32 Server indicate CoreAudio as the last component called. You can find the crash logs in Users/username/Library/Logs/DiagnosticReports. The report will look like this:
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   ???                                     0x04981f90 0 + 77078416
    1   com.apple.audio.CoreAudio               0x949d05c1 __Call_block_invoke_03 + 56
    2   libdispatch.dylib                       0x94a90f8f _dispatch_call_block_and_release + 15
    If this is not the issue you're having, please start a new thread and provide the usual data. If your problem does match this issue, please double-check that you've followed the steps in the new document and post back here.

  • JComboBox Visibility Problem

    Hi, I am trying to use JComboBox for selecting you race and gender in a RPG I am making, but The contents of the JComboBox will not appear in the small version (before you click the little arrow) unless you first move one of the JSliders... Could some one help me figure this out?
    //I call the class with this
         newGamePanel = new newGamePanel();
         newGamePanel.setLayout(null);
         newGamePanel.setBounds(0, 0, programWidth, programHeight);
         newGamePanel.setBackground(Color.black);
         frame.getContentPane().add(newGamePanel);
         newGamePanel.setVisible(true);
         newGamePanel.setUpAlpha();
         newGamePanel.repaint();
    //and here is my class where it all takes place...  The relivent method is setUpAlpha()
    public class newGamePanel extends JPanel//Sets up and grabs the information for the character creation
    implements ActionListener, ChangeListener
         JButton newGameOK;
         JTextField newGameName;
         JComboBox newGameRace, newGameGender;
         JSlider newGameSTR, newGameAGI, newGameVIT, newGameDEX, newGameINT, newGameLUK;
         JLabel nGameName, nGameRace, nGameGender, nGameSTR, nGameAGI, nGameVIT, nGameDEX, nGameINT, nGameLUK;
         int tempScrollA = 5, tempScrollB = 5, tempScrollC = 5, tempScrollD = 5, tempScrollE = 5, tempScrollF = 5;
         public void actionPerformed(ActionEvent e)//Action Performed Block
              if(e.getSource() == newGameOK)
                   gameState = "Story";
                   newGameGetInfo();
                   newGameStoryPanel.newGameStoryPanelInit();
         public void stateChanged(ChangeEvent e)//Scrollbar Listener Block
              if(e.getSource() == newGameSTR)
                   tempScrollA = 10 - (int)newGameSTR.getValue();
                   newGameINT.setValue(tempScrollA);
              if(e.getSource() == newGameINT)
                   tempScrollA = 10 - (int)newGameINT.getValue();
                   newGameSTR.setValue(tempScrollA);
              if(e.getSource() == newGameAGI)
                   tempScrollA = 10 - (int)newGameAGI.getValue();
                   newGameLUK.setValue(tempScrollA);
              if(e.getSource() == newGameLUK)
                   tempScrollA = 10 - (int)newGameLUK.getValue();
                   newGameAGI.setValue(tempScrollA);
              if(e.getSource() == newGameDEX)
                   tempScrollA = 10 - (int)newGameDEX.getValue();
                   newGameVIT.setValue(tempScrollA);
              if(e.getSource() == newGameVIT)
                   tempScrollA = 10 - (int)newGameVIT.getValue();
                   newGameDEX.setValue(tempScrollA);
              tempScrollA = (int)newGameSTR.getValue();
              tempScrollB = (int)newGameAGI.getValue();
              tempScrollC = (int)newGameVIT.getValue();
              tempScrollD = (int)newGameDEX.getValue();
              tempScrollE = (int)newGameINT.getValue();
              tempScrollF = (int)newGameLUK.getValue();
              nGameSTR.setText("Strength: " + tempScrollA);
              nGameAGI.setText("Agility: " + tempScrollB);
              nGameVIT.setText("Vitality: " + tempScrollC);
              nGameDEX.setText("Dexterity: " + tempScrollD);
              nGameINT.setText("Intelligence: " + tempScrollE);
              nGameLUK.setText("Luck: " + tempScrollF);
         public void setUpAlpha()//Huge block to set up Character creation screen
              int tempProgramLeft = (int)(programWidth /2) - 225;
              int tempProgramRight = (int)(programWidth /2) + 25;
              UIManager.put("Label.foreground", Color.white);
              nGameName = new JLabel("Character Name", JLabel.CENTER);
              nGameName.setBounds((int)((programWidth - 250) / 2), 35, 250, 20);
              nGameRace = new JLabel("Character Race", JLabel.CENTER);
              nGameRace.setBounds(tempProgramLeft, 135, 200, 20);
              nGameGender = new JLabel("Character Gender", JLabel.CENTER);
              nGameGender.setBounds(tempProgramRight, 135, 200, 20);
              nGameSTR = new JLabel("Strength: " + tempScrollA, JLabel.CENTER);
              nGameSTR.setBounds(tempProgramLeft, 230, 200, 20);
              nGameINT = new JLabel("Intelligence: " + tempScrollE, JLabel.CENTER);
              nGameINT.setBounds(tempProgramRight, 230, 200, 20);
              nGameVIT = new JLabel("Vitality: " + tempScrollB, JLabel.CENTER);
              nGameVIT.setBounds(tempProgramLeft, 300, 200, 20);
              nGameDEX = new JLabel("Dexterity: " + tempScrollD, JLabel.CENTER);
              nGameDEX.setBounds(tempProgramRight, 300, 200, 20);
              nGameAGI = new JLabel("Agility: " + tempScrollC, JLabel.CENTER);
              nGameAGI.setBounds(tempProgramRight, 370, 200, 20);
              nGameLUK = new JLabel("Luck: " + tempScrollF, JLabel.CENTER);
              nGameLUK.setBounds(tempProgramLeft, 370, 200, 20);
              newGameOK = new JButton("Start Game", null);
              newGameOK.setHorizontalTextPosition(AbstractButton.CENTER);
              newGameOK.setBackground(Color.black);
              newGameOK.setForeground(Color.white);
              newGameOK.setBounds((int)((programWidth - 100) / 2), 450, 100, 30);
              newGameOK.setBorder(BorderFactory.createMatteBorder(3, 3, 3, 3, Color.white));
              newGameName = new JTextField("Enter Name", 20);
              newGameName.setFont(new Font("Times New Roman", Font.BOLD, 12));
              newGameName.setForeground(Color.red);
              newGameName.setBackground(Color.black);
              newGameName.setBounds((int)((programWidth - 250) / 2), 60, 250, 25);
              newGameName.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.white));
         //     UIManager.put("ComboBox.foreground", Color.red);
         //     UIManager.put("ComboBox.background", Color.black);
         //     UIManager.put("ComboBox.border", BorderFactory.createMatteBorder(0, 0, 0, 7, Color.white));
              String[] newGameRaceAAA = {"Human", "Elf", "Dwarf"};
              newGameRace = new JComboBox(newGameRaceAAA);
              newGameRace.setSelectedIndex(0);
              newGameRace.setBounds(tempProgramLeft, 160, 200, 20);
              newGameRace.addActionListener(this);
              String[] newGameGenderAAA = {"Male", "Female"};
              newGameGender = new JComboBox(newGameGenderAAA);
              newGameGender.setSelectedIndex(0);
              newGameGender.setBounds(tempProgramRight, 160, 200, 20);
              newGameGender.addActionListener(this);
              UIManager.put("Slider.background", Color.black);
              newGameSTR = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
              newGameAGI = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
              newGameVIT = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
              newGameDEX = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
              newGameINT = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
              newGameLUK = new JSlider(JSlider.HORIZONTAL, 1, 9, 5);
              newGameSTR.setBounds(tempProgramLeft, 250, 200, 15);
              newGameINT.setBounds(tempProgramRight, 250, 200, 15);
              newGameVIT.setBounds(tempProgramLeft, 320, 200, 15);
              newGameDEX.setBounds(tempProgramRight, 320, 200, 15);
              newGameLUK.setBounds(tempProgramLeft, 390, 200, 15);
              newGameAGI.setBounds(tempProgramRight, 390, 200, 15);
              visiblePanelChecker();
              this.add(newGameOK);
              this.add(newGameName);
              this.add(newGameRace);
              this.add(newGameGender);
              this.add(newGameSTR);
              this.add(newGameAGI);
              this.add(newGameVIT);
              this.add(newGameDEX);
              this.add(newGameINT);
              this.add(newGameLUK);
              this.add(nGameName);
              this.add(nGameRace);
              this.add(nGameGender);
              this.add(nGameSTR);
              this.add(nGameAGI);
              this.add(nGameVIT);
              this.add(nGameDEX);
              this.add(nGameINT);
              this.add(nGameLUK);
              newGameOK.addActionListener(this);
              newGameSTR.addChangeListener(this);
              newGameAGI.addChangeListener(this);
              newGameVIT.addChangeListener(this);
              newGameDEX.addChangeListener(this);
              newGameINT.addChangeListener(this);
              newGameLUK.addChangeListener(this);
              newGameOK.setVisible(true);
              newGameName.setVisible(true);
              newGameRace.setVisible(true);
              newGameGender.setVisible(true);
              newGameSTR.setVisible(true);
              newGameAGI.setVisible(true);
              newGameVIT.setVisible(true);
              newGameDEX.setVisible(true);
              newGameINT.setVisible(true);
              newGameLUK.setVisible(true);
              nGameName.setVisible(true);
              nGameRace.setVisible(true);
              nGameGender.setVisible(true);
              nGameSTR.setVisible(true);
              nGameAGI.setVisible(true);
              nGameVIT.setVisible(true);
              nGameDEX.setVisible(true);
              nGameINT.setVisible(true);
              nGameLUK.setVisible(true);
              repaint();
         public void newGameGetInfo()//Grabs the information from the items in the New Game
              hero = new Chara();
              hero.name = newGameName.getText();
              hero.name = hero.name.trim();
              if(hero.name.length() > 10){hero.name = hero.name.substring(0, 10);}
              hero.race = (String)newGameRace.getSelectedItem();
              hero.gender = (String)newGameGender.getSelectedItem();
              for(int i = 0; i < 2; i ++)
                   hero.strength[i] = tempScrollA;
                   hero.agility[i] = tempScrollB;
                   hero.vitality[i] = tempScrollC;
                   hero.dexterity[i] = tempScrollD;
                   hero.intelligence[i] = tempScrollE;
                   hero.luck[i] = tempScrollF;
              if(hero.race == "Human")
                   hero.strength[2] = 1;
                   hero.agility[2] = 1;
                   hero.vitality[2] = 1;
                   hero.dexterity[2] = 1;
                   hero.intelligence[2] = 1;
                   hero.luck[2] = 1;
              if(hero.race == "Elf")
                   hero.strength[2] = 0;
                   hero.agility[2] = 2;
                   hero.vitality[2] = 0;
                   hero.dexterity[2] = 2;
                   hero.intelligence[2] = 2;
                   hero.luck[2] = 0;
              if(hero.race == "Dwarf")
                   hero.strength[2] = 3;
                   hero.agility[2] = 0;
                   hero.vitality[2] = 2;
                   hero.dexterity[2] = 0;
                   hero.intelligence[2] = 0;
                   hero.luck[2] = 1;
              int hp[] = new int[3];//Min/Max HP
              int mp[] = new int[3];//Min/Max SP
              hero.level = 1;
              hero.job = "Novice";
              hero.status = "Normal";
              hero.property = "Normal";
              for(int i = 0; i < hero.location.length; i++)
                   for(int a = 0; a < hero.location.length; a++)
                        hero.location[i][a] = 320;
              menuActivate();
              resetNewGameStuff();
              visiblePanelChecker();
         public void resetNewGameStuff()//Resets the values in the items for the New Game
              newGameName = null;
              newGameRace = newGameGender = null;
              newGameSTR = newGameAGI = newGameVIT = newGameDEX = newGameINT = newGameLUK = null;
              nGameSTR = nGameAGI = nGameVIT = nGameDEX = nGameINT = nGameLUK = null;

    Is there anybody who can help me? I need Help guys......

  • How to complain to Apple about this company and how to get a formally answer for problem with Apple agent in Kuwait??

    How to complain to Apple about this company and how to get a formally answer for problem with Apple agent in Kuwait??

    You did not buy your iphone from an Apple store.  No Apple employee sold you anything.
    Your complaint is not with Apple.  You bought from an unauthorized seller.  Your complain is with that seller.
    As you have been told more than once, Apple has nothing to do with this.

  • Firefox 33 is about to come out soon and you should test for problems

    Next week, Firefox 33 is going to come out. You should test for problems and have them fixed. In Firefox 32, people had problems with videos buffering at 0:14 and videos buffering when you skip through them.

    That is what Beta test versions are for. But sometimes something gets thru.

  • Which tool best for problem checking

    guys, which tool, free or not is the best solution to use to check the system/harddrive for problems?

    Like Steve says, you should always start out with Disk Utility. It comes with the computer. Another utility that comes with the computer is the Apple Hardware Test (AHT). It's very good for diagnosing hardware problems. However, its messages aren't necessarily the most helpful. However, if the AHT flags an error, it's a good idea to have the computer looked at by an Apple technician.
    Two other utilities that aren't free are TechTool Pro and Alsoft's DiskWarrior. However, DiskWarrior is currently not compatible with Intel-based Macs. Its focus is mainly on rebuilding the disk directory, the catalog of which files you have and where they are on your drive. DiskWarrior can often fix problems that Disk Utility can't.
    TechTool Pro, on the other hand, is a more comprehensive diagnostic tool. It can check your main memory, ports, etc. One important hard drive test it can do is a surface scan, where it tries every sector on your disk, looking for bad blocks. While the Apple Hardware Test does some of the same tests (memory, processor, etc.), TechTool Pro's results are generally more informative than those from the AHT. For example, you can get a detailed summary of your hard drive's S.M.A.R.T. attributes.
    I'll also mention smartmontools, a command-line tool to check and monitor the S.M.A.R.T. system in your drive. This one's for real geeks, though, as you need to download the source code and compile it yourself. However, it also prints out very detailed reports on the status of your drive.
    Finally, though these tools are pretty good to have around, they're no substitute for a good backup, either of your data, or your whole system. Sometimes drives just fail without warning, and none of the software would help. That's when having a recent backup is crucial. I'm a big fan of Shirt Pocket's Super Duper!. It makes backing up pretty painless, and has saved me from major heartache a couple of times.
    Another drive cloning program is Mike Bombich's Carbon Copy Cloner. It's quite usable, and it's donationware, so the price can be cheaper than Super Duper!, but it's also a bit more difficult to use, especially in making partial backups.
    charlie

  • JComboBox listener problem

    Hi all,
    I have following problem, i use combobox and i need to write listener for selecting item.
    But both ActionListener and ItemListener are unusable for me, because i dont know how to differ between selecting item when combobox is poped up.
    I dont want to react on going thru items in popup, but only to FINAL select of button.
    Please Help.
    Mathew, HSIGP

         This works on non editable combo boxes
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class ComboBoxAction extends JFrame implements ActionListener
         JComboBox comboBox;
         public ComboBoxAction()
              comboBox = new JComboBox();
              comboBox.addActionListener( this );
              comboBox.addItem( "Item 1" );
              comboBox.addItem( "Item 2" );
              comboBox.addItem( "Item 3" );
              comboBox.addItem( "Item 4" );
              //  This prevents action events from being fired when the
              //  up/down arrow keys are used on the dropdown menu
              comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
              getContentPane().add( comboBox );
         public void actionPerformed(ActionEvent e)
              System.out.println( comboBox.getSelectedItem() );
              //  make sure popup is closed when 'isTableCellEditor' is used
              comboBox.hidePopup();
         public static void main(String[] args)
              final ComboBoxAction frame = new ComboBoxAction();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible( true );
    }

  • JComboBox Render Problem........

    Hi I have a problem in JCombox renderer in my application Problem is i have Three comboBox columns in my table wing same Renderer and Editor. second and third combo column's aree working fine But in first combo-column if i add a new row clicking add button and if change a value in top- most comboBox i will reflect in all ComboBox's below, this is not happening in othe two Combo-column. i'am not at all gettin why this happens where i am using same renderer for all combo-columns how to stop this, When a new row is add ComboBox first item as Selected,
    Can any one please tell me how to solve this,
    since i cannot past entair application i am pasting example with similar suituation using same renderer.
    Thank's in Advance
    CODE:-
    import java.awt.BorderLayout;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.DefaultCellEditor;
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    * @author 501376972
    public class MainTable extends JFrame{
    DefaultTableModel model = null;
    JTable table = null;
    JScrollPane scrollpane = null;
    JButton btCancel = null;
    JButton btADD = null;
    JPanel panelButton = null;
    public Object[][] data = null;
    String column[] = {" ","A","B","C","D","E","F"};
    String oprator[] = {" ","=","/","*","-","+"};
    String number[] = {" ","1","2","3","4","5","6"};
    /** Creates a new instance of MainTable */
    public MainTable() {
    model = new DefaultTableModel();
    model.addColumn("Column");
    model.addColumn("Operator");
    model.addColumn("Value");
    model.addColumn("Number");
    table = new JTable();
    table.setModel(model);
    data = new Object[][]{
    {column, oprator, null, number}
    model.addRow(data);
    TableColumn colCol = table.getColumnModel().getColumn(0);
    colCol.setCellRenderer(new ComboBoxCellRenderer(column));
    colCol.setCellEditor(new ComboBoxCellEditor(column));
    TableColumn colOpr = table.getColumnModel().getColumn(1);
    colOpr.setCellRenderer(new ComboBoxCellRenderer(oprator));
    colOpr.setCellEditor(new ComboBoxCellEditor(oprator));
    TableColumn colLog = table.getColumnModel().getColumn(3);
    colLog.setCellRenderer(new ComboBoxCellRenderer(number));
    colLog.setCellEditor(new ComboBoxCellEditor(number));
    scrollpane = new JScrollPane(table);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(scrollpane,BorderLayout.CENTER);
    panelButton = new JPanel();
    btADD = new JButton("ADD");
    btCancel = new JButton("Cancel");
    panelButton.add(btADD);
    panelButton.add(btCancel);
    getContentPane().add(panelButton,BorderLayout.SOUTH);
    btCancel.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e) {
    dispose();
    btADD.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e) {
    model.addRow(data);
    getContentPane().add(scrollpane);
    setSize(500,500);
    class ComboBoxCellRenderer extends JComboBox implements TableCellRenderer {
    public ComboBoxCellRenderer(String[] items) {
    super(items);
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    if (isSelected) {
    //DO NOTHIING
    } else {
    //DO NOTHIING
    // Select the current value
    if(value == null)
    setSelectedIndex(0);
    else
    setSelectedItem(value);
    return this;
    public class ComboBoxCellEditor extends DefaultCellEditor {
    public ComboBoxCellEditor(String[] items) {
    super(new JComboBox(items));
    * @param args the command line arguments
    public static void main(String[] args) {
    MainTable mt = new MainTable();
    mt.setVisible(true);
    }

    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.
    Don't know why the code works the way it does, but the code is wrong. The correct way to add a row is like this:
    //model.addRow(data);
    String[] rowData = { " ", " ", " ", " "};
    model.addRow(rowData);

  • JComboBox addActionListener problem?

    HI,
    i am using JComboBox to add each item action perform of use StyleEditorKit.FontSizeAction("String", int), but i only can add one item action perform only. See my code any problem...
    for(int i>12;i<=50 ; i++){
                  comboBox.addItem(" "+i);
               // i want to loop each item can function
                comboBox.addActionListener(new StyleEditorKit.FontSizeAcion("i ", i)Thanks

    FontSizeAction is able to set the size to a value delivered in String format as the command String of its ActionEvent. Unfortunately, the JComboBox doesn't deliver the String value of the selected item as command string but an arbitrary value to be set once. So you have to wrap your FontSizeAction in a custom ActionListener of your own where you retrieve the selected item, cast it to a String and pass this value to FontSizeAction as the command String of a new ActionEvent object.
    You should also get rid of that whitespace when creating the size value, String.valueOf(int) is a better way to create a String for an int.

  • JComboBox Dropping Problem

    Hi, I have a JComboBox in a table cell with all the Item I need. But the problem is when I click on JComboBox, dropdown menu pops up and immediately hides automatically. And cannot allow me to choose anything.
    Any suggestions plz.
    Thanks

    You've got a coding problem, so read this section from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html]How to Use Combo Boxes for example on how to do this correctly.

  • 2 JComboBox  sync problem

    Hi, im getting crazy with this error. I have two different JComboBox with two differents DefaultComboBoxModel.
    The first shows a list of files.
    The second shows a data list from the selected file in the first.
    When i select a different file in the first combo, i want to change the data list in the second combo. So i call the removeAllElements method in the DefaultComboBoxModel, but i dont know why, then the second combo code is executed too (it shouldnt) and i get an error.
    The code is something like this:
    cmb1 is a jcombobox linked to dcbm1, which is a defaultcomboboxmodel
    cmb2 is a jcombobox linked to dcbm2, which is a defaultcomboboxmodel
    MyObject is a customized class which has two fields: a Vector and a String. There is a Vector of MyObject, where is load the file data.
      void cmb1_actionPerformed(ActionEvent e){
        dcbm2.removeAllElements();
        // Load the file
        // Get data load on vector (class Vector)
        // Then, send data from vector to 2nd combomodel:
        for (int i=0; i<vector.size(); i++){
          mo = (MyObject)vector.get(i);
          dcbm2.addElement(mo.getString());
      void cmb2_actionPerformed(ActionEvent e){
        dlm.clear();                                                    // ListModel which i use to show data
        int x = cmb2.getSelectedIndex();
        m = (MyObject)vector.get(x);                       // This line throws the error (ArrayOutOfBounds). x=-1
        vector2 = m.getVector();
        for (int i=0; i<vector2.size(); i++){
          dlm.addElement((vector2.getString()
      }So thats my problem. When i select an item in the 1st combo, the 2nd combo code is executed too, throwing an ArrayIndexOutOfBounds because there is no item selected

    as I see, in this listing, you did not try using what I told you before, try using this:
    public void actionPerformed(ActionEvent e) {
         Object obj = e.getSource();
         if (obj == cmbFiles) {
              parser = new MyXMLParser((String) dcbmFiles.getSelectedItem());
              try {
                   carrera = parser.read();
              } catch (Exception z) {
                   z.printStackTrace();
              cursos = carrera.getCursos();
              for (int i = 0; i < cursos.size(); i++) {
                   cur = (Curso) cursos.get(i);
                   dcbmCursos.addElement(cur.getCurso());
         } else if (obj == cmbCursos) {
              dlmAsignaturas.clear();
              int x = cmbCursos.getSelectedIndex();
              cur = (Curso) cursos.get(x);
              asignaturas = cur.getAsignaturas();
              for (int i = 0; i < asignaturas.size(); i++) {
                   dlmAsignaturas.addElement(
                        ((Asignatura) asignaturas.get(i)).getId()
                             + ((Asignatura) asignaturas.get(i)).getGrupo().toLowerCase());
    }

  • Possible solution for problems printing with ICC profiles - esp. R2400

    (N.B. This is long because I've decided to go in to details about the background of the problem etc.. Also note that whilst my experience is with the Epson R2400, anyone with problems printing using ICC profiles in Aperture may find this post helpful, as will be explained further down the post.)
    Ok, here's the situation. I've been an Aperture user for over a year, and an R2400 owner for half a year. In that time I have done a huge amount of experimenting, but I've never managed to get Aperture to work perfectly with Epson's 'premium' R2400 ICC profiles - the ones you can download from their site which are better than the ones provided 'in the box'. This hasn't been too big a deal because, in fact, the R2400 does a rather good job just set to 'System Managed' in Aperture and 'Epson Vivid' with a gamma of 1.8 in the printer driver. Nevertheless, it really annoyed me that something that should work wasn't, which is why I've spent a lot of time trying to figure out what's going on. Having said that, I have come across a method which will give you pretty good prints out of your Epson R2400 using the premium profiles in Aperture - it's not perfect, but it's the best you're going to get if you want to use those profiles in Aperture. I understand the words 'it's not perfect' aren't what photography experts would probably want to hear, however, I have seen a few anguished posts from R2400 owners in here before, so I think some people may find it useful.
    The whole reason why Aperture is hopeless at using the R2400's premium profiles is because - unusually - their default rendering intent is set to 'relative colorimetric' rather than 'perceptual'. You might say 'but that's good - it means you get more accurate colours!', and if you do, you're right... however, there's a snag. To get an image to reproduce well using Epson's premium profiles and relative colorimetric rendering, you really need to use black point compensation. This is where the trouble lies: Aperture's black point compensation is diabolical to the point of being unusable when used with relative colorimetric rendering - I feel I need to be awarded compensation every time I've ever tempted to use the setting. So because BPC in Aperture is unusable, that effectively makes the premium profiles unusable too, because Aperture always uses the default rendering intent specified in the profile.
    The solution? Use perceptual rendering instead. Ok, so you can't change the rendering intent in Aperture, which makes that sound a tad difficult. However, as I said in the above paragraph, Aperture always obeys the default rendering intent specified in the profile... so you can see where we're going with this: we need to change the ICC profiles' default rendering intent from 'relative colorimetric' to 'perceptual'. I did some digging around and found one or two expensive pieces of software that could do that... but then I found that, lo and behold, the Mac OS has a command-line utility which can do the job for us, for precisely £0.00. It's called SIPS or 'Scriptable Image Processing System', and you can find out some information about it here: http://developer.apple.com/technotes/tn/tn2035.html#TNTAG58 For those who don't like reading technical jargon however, here's what you need to do to convert a profile's rendering intent. First go to terminal, then type in the following command:
    sips -s renderingIntent perceptual
    Do not press 'enter' yet. Instead, add a space after 'perceptual', find the ICC profile you want to modify, and click and drag it into the terminal window. You should then find that your command looks something like this:
    sips -s renderingIntent perceptual /Users/yourname/folder/RandomProfile.ICC
    At which point you can then press 'enter', and the command will execute, giving you an ICC profile which will now make Aperture use perceptual rendering.
    There is just one further thing to be aware of after doing this: for some crazy reason, you then need to turn on BPC in Aperture for the prints to come out as good as possible. Black point compensation shouldn't make any difference when using perceptual rendering as the idea of perceptual is that it takes account of things like that anyway, however, in Aperture BPC does make a difference, so remember to turn it on to get a half decent print. In general, I find that prints made using this setup come out pretty well; they almost perfectly match prints made using the profiles with a perceptual intent in Photoshop Elements, except for the fact that Aperture blocks up the shadows a bit more than Photoshop. However, if you can live with that, you might find this is quite a workable solution.
    Now, I said near the beginning of this post that all the above can apply to other printers too. Most printer profiles have 'perceptual' set as their default rendering intent, in which case everything I've just said won't be of much help. However, If you are reading this because you're having problems with ICC profiles in Aperture, but you don't use an Epson R2400, find your problematic ICC profile, double-click on it, and take a look at the window that opens: specifically, at the 'Rendering Intent' the window mentions. If it doesn't say 'Perceptual' then it may well be worth trying the steps I've outlined in this post to set it to perceptual, to see if doing so produces an improvement when using the profile in Aperture.
    Finally, just one note of caution: if you decide to try out the steps I've detailed above on a paid-for custom-made profile, please back your profile up before messing with it. I haven't experienced any problems when using SIPS to change a profile's rendering intent, but I obviously can't guarantee that it won't do something weird and corrupt your expensive custom-made profile.
    If you have any questions, feel free to ask, although (contrary to any impression I may give) I am not a colour-management expert; I'm just someone who doesn't give up when they have a problem that should be solvable.
    Thomas
    Mac Pro 2.0GHz with 30" ACD; 15" MacBook Pro 2.0GHz   Mac OS X (10.4.10)  

    Thomas
    Wow - thanks for such a comprehensive post.
    I have Aperture and a 2400 so this information is exceptionally useful to me.
    Again - thanks for caring and sharing
    Brian

  • Best Program(s) & Order for Problem (Kernel Panic on Start-Up)?

    I started off the problems trying to open a file in Pages ('08). Tried different files and such to try and get it to work, but didn't work. I restarted into single-user mode to boot Applejack to see if my disk had errors again (a previous run had fixed the ones it found).
    However, upon booting into it, it hung and after a while was still stuck at the same part of loading (some messages talking about errors). I turned off the power and then turned it back on, but when I got to the boot screen, my Mac kernel panicked, and it continued to do this.
    I then tried booting into my OS CD, and although Disk Utility repaired permissions, it ran into errors along these lines:
    Checking HFS Plus volume.
    Checking Extents Overflow file.
    Checking Catalog file.
    Checking multi-linked files.
    <<sibling link error something or other>>
    Error: The underlying task reported failure on exit
    1 HFS volume checked
    Volume needs repair
    So I figured a third-party tool would probably be more of a help. Looked at info about Data Rescue II, TechTool Pro, and DiskWarrior. Would any of those be a help for me? My primary concern is backing up the data on the drive (I have an external drive which functions fine, and enough free space, just no back-up because I figured Apple wouldn't push Leopard back), and after that getting the drive/computer to work, both if possible. Should I use more than one, and is there any particular order that would be necessary? Or would I be better off with doing something else?
    (and this is fresh off the heels of a new battery for those random shutdowns, too...)

    I am in the same boat. I have just spent half the day researching what is going on with my machine.
    I am getting the Kernal Panic screen on startup. Booted up from the Install disk and ran Disk Utility and came across the Invalid Sibling Link, and that the Volume needs to be repaired.
    I had backup of my hard drive scheduled for tomorrow but now this has happened. I am curious as to how I can retrieve the information safely to back it up to a different drive AND figure out how to solve this problem.
    Is Disk Warrior going to do the trick? And if so, can I still retrieve the information off of it?

Maybe you are looking for

  • On dvd player, main menu is a folder

    trying to have my subject be descriptive there. so i made a movie from video clips and photos in imovie, and then used idvd to make a dvd, as i'd like to send copies to other family members. now when i put the dvd in my dvd player, the first page is

  • Can Quicken for Windows work on a Mac w/Lion installed using Parallels?

    I've never used Parallels but am panicking with the phaseout of the already anemic Quicken for Mac 2007.  Has anybody used the more powerful Windows version of Quicken on a Mac through Parallels or some other PC emulator?  And will it work with Lion?

  • Error in Funds Mgmt.

    Hello Sapients, We are currently upgrading to ECC 6 from 4.7(public sector). Getting an error "No funds center entered/delivered in item 00001 (msg #FI313)" in MIGO. Suggest a work around. Thank you Ibex

  • Was using the crop tool without problem.  Not letting me change crop dimensions.  What do I do?

    Was using the crop tool without problem.  Not letting me change crop dimensions.  What do I do? using photoshop

  • Applet can not run in IE

    Hello, I wrote an Applet in JBuilder. I use tag <applet archive = "test.jar" > But it doesn't run in IE, may be JVM was not installed in my PC. How can I install JVM. when installing JVM, is it need Windows CD or any files else.