Inserting image in ADF Swing

I'm using Jdeveloper 11.1.1.2.0, i'm trying to show an image stored in an oracle databese in a jSplitPanel.
Using jUImageControl i'm able to find the correct row, but the image is never displayed.
The log does not return any error.
Could you help me to find a method to show up the image? (in the DB it is stored as "long row" column type)

I'm using Jdeveloper 11.1.1.2.0, i'm trying to show an image stored in an oracle databese in a jSplitPanel.
Using jUImageControl i'm able to find the correct row, but the image is never displayed.
The log does not return any error.
Could you help me to find a method to show up the image? (in the DB it is stored as "long row" column type)

Similar Messages

  • JDeveloper 10.1.3.3 ADF Swing - Images not rendering after deployment

    Hi,
    I have deployed my ADF Swing application in production in very simple 2 tiers architecture.
    One executal jar on my desktop and
    The database running on a Linux server.
    When I run MyApp.jar from my desktop, none of my images is rendered and LOV buttons do NOT work.
    The same application runs against the same dabase from Jedev environment shows images and LOVs work fine.
    Thank for your your help.

    I suppose that you use Java WebStart to deploy your application.
    The issue might be that you're using absolute path to load images into the application (c:\something\something.jpg). When you start your app in webstart, it doesn't allow the application the acces to the disk using absolute path. Even if it did, you wouldn't find your images in the same folder as they are on your disk.
    You should load images like this:
    ImageIcon icon=new ImageIcon(this.getClass().getResource("images/something.jpg"));
    This presumes that you store all your images in "images" package (folder).
    You can read more here:
    http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/development.html#retrieving

  • Inserting image in to database !!

    Hi All,
    I have to insert image in to the database. My image is there in swing object Image. Is there any way to insert that image in to the database.
    Any body having knowledge on this, Please help.
    Thanks in advance.
    Regards,
    Roja.

    Hi
    Take a look to this code I found surfing, it creates an image from url then resize it and return it as byte array that you can use to set a blob in the database:
    public static byte [] resizeImage(URL url,int widthConstraint,int heightConstraint) throws ImageFormatException, IOException
         ImageIcon imageIcon = new ImageIcon(url);
         Image img = imageIcon.getImage();
         int imgWidth = imageIcon.getIconWidth();
         int imgHeight = imageIcon.getIconHeight();
         ImageIcon adjustedImg=null;
         if ( imgWidth>0 && imgHeight>0)//imgWidth > widthConstraint | imgHeight >  heightConstraint )
         if ( imgWidth > imgHeight )
           // Create a resizing ratio.
           double ratio = (double) imgWidth / (double)
            widthConstraint;
           int newHeight = (int) ( (double) imgHeight / ratio );
           // use Image.getScaledInstance( w, h,
           // constant), where constant is a constant
           // pulled from the Image class indicating how
           // process the image; smooth image, fast
           // processing, etc.
           adjustedImg = new ImageIcon(
            imageIcon.getImage().getScaledInstance(
              widthConstraint, newHeight,
              Image.SCALE_SMOOTH )
         else
           // Create a resizing ratio.
           double ratio = (double) imgHeight / (double)
            heightConstraint;
           int newWidth = (int) ( (double) imgWidth / ratio );
           adjustedImg = new ImageIcon(
           imageIcon.getImage().getScaledInstance( newWidth,
              heightConstraint, Image.SCALE_SMOOTH )
         int resizeWidth = adjustedImg.getIconWidth();
         int resizeHeight = adjustedImg.getIconHeight();
         Panel p = new Panel();
         BufferedImage bi = new BufferedImage(resizeWidth, resizeHeight,
         BufferedImage.TYPE_INT_RGB);
         Graphics2D big = bi.createGraphics();
         big.drawImage(adjustedImg.getImage(), 0, 0, p);
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
         encoder.encode(bi);
         byte[] byteArray = os.toByteArray();
         return byteArray;
      else
      return new byte[0];
       }hope this helps.

  • Inserting image in rtf doc

    Hi all,
    i am trying to make my own rtf editor , I've read the most of the toppics in this forum on this issue,
    but I'm stucked on inserting the hex Data into the document.
    Do I actually need to override ImageView?
    I found a method in RTFReader (instantiated from read(InputStream in,...)) handleBinaryBlob(byte[] data).
    RTFReader is private, so I cannot override this method. Should I override the read method in
    RTFEditorKit and then call the read method in DefaultEditorKit, or I could just use the doc.insertString(...) with the binary data inside of the overriden RTFEditorKit read method? I will lose the functionallity of the RTFParser this way.
    I know I should override read and write methods but how?
    So could somebody help me on this?
    The code for creating the binary data from buffered image and creating the Icon from StanislavL follows:
    ImageIcon icon=(ImageIcon)StyleConstants.getIcon(attr);
    if (icon!=null) {
    int w=StyleConstants.getIcon(attr).getIconWidth();
    int h=StyleConstants.getIcon(attr).getIconHeight();
    ByteArrayOutputStream os=new ByteArrayOutputStream();
    PNGCodec p=new PNGCodec();
    ImageEncoder pe=p.createImageEncoder("PNG",os,null);
    BufferedImage bi=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
    bi.getGraphics().drawImage(icon.getImage(),0,0,null);
    pe.encode(bi);
    byte[] ba=os.toByteArray();
    int len=ba.length,i;
    StringBuffer sb=new StringBuffer(len*2);
    for (i=0;i<len;i++) {
    String sByte=Integer.toHexString((int)ba & 0xFF);
    if (sByte.length()<2)
    sb.append('0'+sByte);
    else
    sb.append(sByte);
    String s=sb.toString();
    out.write("{\\pict\\pngblip ");
    out.write(s);
    out.write("}");
    extracting image
    String content; //<- image representation
    int len=content.length();
    //converts to binary representation
    byte[] buf=new byte[len/2];
    for (int j=0; j<len/2 ;j++) {
    String c1=content.substring(j*2,j*2+1);
    String c2=content.substring(j*2+1,j*2+2);
    byte b1=Byte.parseByte(c1,16);
    byte b2=Byte.parseByte(c2,16);
    buf[j]=(byte)(b1*16+b2);
    //creates image from binary
    Image img = Toolkit.getDefaultToolkit().createImage(buf);
    ImageIcon icon=new ImageIcon();
    icon.setImage(img);
    if ((icon.getIconHeight()<0) || (icon.getIconWidth()<0))
    return;
    MutableAttributeSet attr=new SimpleAttributeSet();
    StyleConstants.setIcon(attr,icon);
    //inserts image in the document
    document.insertString(currentOffset," ",attr);
    currentOffset++;
    I guess these two functions must be implied into the overriden EditKit write and read methods.
    Could somebody give me a start idea?
    regards
    rumpi

    Thanks for reply.
    It did't helped me a lot or I'dont really understand your idea.
    What you say in your postings is build my own reader and writer.
    For example to open a rtf file in my jeditorpane I must read from
    the input stream each byte and reimplementing AbstractFilter, RTFParser and RTFReader
    I could get all headers like \par or \pic and then rtfDoc.insertString(pos, "the label content", attr) with the attributes extracted from header.
    When that is the only way I am asking myself what are the swing people for?!?!
    I'll try to do that myself, so I'm not asking for code but I would appreciate
    some detailed info about it. For example when I dont use RTFReader anymore
    I loose everything what I've got untill now. So I should read every byte opening a file
    and check like in RTFParser if the first character is "\", then the next couple of bytes
    untill I get the header. Then I should check which labels(text) is this header for(until the next header), so
    I could insert a string with the according attribute set? For Icon when I get the
    \pic header I read the byte sequence and build the picture just like you wrote.
    My Editor is an applet so I've hoped I wouldn't send too much code to the client
    so reimplementing RTFParser, Reader... would slow it down, but whatever.
    Thats really a lot of work only because the given classes are not extendable, grrrr.
    Viravan, thanks for the fast reply , but like I said , I 've already read all relevant
    postings in this forum and didnt found something really helpful. I already read all
    tutorials and articles from sun about this issue and I still have the feeling I'm a freshman
    in this area.
    I'm still angry with the swing team about it, this bug is noted since 2001 I think. grrr
    regards
    rumpi

  • MYSQL error in JDeveloper 10g using ADF Swing

    I am trying to update data in mysql database. But the following error appears in JDeveloper 10g using ADF Swing
    Mysql library is mysql-connector-java-3.1.12
    What is the problem ? INSERT and SELECT queries do not give errors. But UPDATE has problem.
    Thank you in advance.
    Sony Kalkan
    (oracle.jbo.DMLException) JBO-26041: Failed to post data to database during "Update": SQL Statement "UPDATE banner Banner SET imptotal=? WHERE bid=?".
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) You have an error in your SQL syntax near 'Banner SET imptotal=22 WHERE bid=1' at line 1

    After i put a jtable,navigator on the form using appmoduledatacontrol on the top-right side of the jdeveloper, i run the form. Everything goes ok listing rows of data. But the error appears when i change the value of a field on the table and updating it using navigator.
    Thank you very much.

  • Change Row Backgroud color in Jtable : ADF Swings

    Hi ,
    I have developed a ADF Swings Details Form . On Details FORM LOAD if Check Box is TRUE( means selected) i have to change the back ground color of the JTable row and also i have make that row as READ ONLY mode .
    Need help.
    Regards
    Bhanu Prakash

    ok i found how to do it
    i directly inserted this in the renderer code:
    if (row == table.getSelectedRow() && column == table.getSelectedColumn())
    cell.setBackground(etc);
    (curiously it does not work with "if (isSelected)")
    thanks :)

  • Inserting images to mark text boundaries

    Ive added text to a JTextPane from a file.
    and by mouse click ive inserted character
    to mark the boundaries of the text.
    instead of character ive to do with images
    for marking the segment boundaries.
    please suggest me some method for inserting
    images in TextPane for marking boundaries

    Sorry Andre..Still im not getting what you are saying.. im trying to do like this..Could u pls suggest me where i went wrong..Im inserting the icon directly to textpane..rather than to label nd inserting label to textpane bcos label with image cant be retained when mouse is clicked over several times in textpane....
    import java.awt.Cursor;
    import java.awt.Image;
    import java.awt.Point;
    import java.awt.Toolkit;
    import java.io.*;
    import java.util.Enumeration;
    import java.util.Vector;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import ncst.pgdst.*;
    import java.awt.Color;
    import javax.swing.ImageIcon;
    import javax.swing.text.*;
    import com.sun.org.apache.xerces.internal.impl.io.UTF8Reader;
    import java.util.Collection;
    import java.util.Iterator;
    import java.util.StringTokenizer;
    import java.awt.BasicStroke;
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.geom.Ellipse2D;
    import java.awt.geom.Line2D;
    import javax.swing.text.DefaultStyledDocument;
    public class EditFormGui  extends javax.swing.JFrame{
        private javax.swing.JMenu fileMenu;
        private javax.swing.JMenuBar jMenuBar1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JLabel labelModes;
        private javax.swing.JPanel leftPanel;
        private javax.swing.JMenuItem loadRST;
        private javax.swing.JButton paraSegment;
        private javax.swing.JMenuItem quit;
        private javax.swing.JMenuItem save;
        private javax.swing.JButton saveSegmentMode;
        private javax.swing.JButton editSegment;
        private javax.swing.JButton showStructure;
        private javax.swing.JButton showText;
        private javax.swing.JMenu structureMenu;
        private javax.swing.JTextPane textPane;
        private javax.swing.JPanel textPanel;
        private boolean segmentFlag = false,debug=true;
        private UserText userText=new UserText();
        private JPanel structureframe=new JPanel();
        private javax.swing.JTabbedPane jTabbedPane;
        private java.util.Vector pNodesVector = new java.util.Vector();
        private javax.swing.JComboBox relationList;
        private javax.swing.JFrame relationChooserFrame = new javax.swing.JFrame();
        private javax.swing.JScrollPane relationScrollPane = new javax.swing.JScrollPane();
        private JLabel label_image;
        ImageIcon icon;
        Cursor c;
        String[] store;
        int posX_icon,posY_icon;
        Point iconPos;
        Vector iconPositions;
        public EditFormGui() {
            initComponents();
        public void initComponents()
            jTabbedPane = new javax.swing.JTabbedPane();
            textPanel = new javax.swing.JPanel();
            iconPositions=new Vector();
            saveSegmentMode = new javax.swing.JButton();
            editSegment=new javax.swing.JButton();
            showText = new javax.swing.JButton();
            showStructure = new javax.swing.JButton();
            labelModes = new javax.swing.JLabel();
            jScrollPane1 = new javax.swing.JScrollPane();
            jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
            textPane = new javax.swing.JTextPane();
            textPane.setEditable(false);
             icon = new ImageIcon("F:/images/division.jpg");
             label_image = new JLabel(icon);
            jMenuBar1 = new javax.swing.JMenuBar();
            fileMenu = new javax.swing.JMenu();
            loadRST = new javax.swing.JMenuItem();
            save = new javax.swing.JMenuItem();
            quit = new javax.swing.JMenuItem();
            structureMenu = new javax.swing.JMenu();
          Toolkit tk = Toolkit.getDefaultToolkit();
          Image image =tk.getImage("F:/images/del.jpg");
          c= tk.createCustomCursor(image , new Point(0,0), "F:/images/del.jpg");
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            saveSegmentMode.setText("Save Segment");
            saveSegmentMode.addActionListener(new java.awt.event.ActionListener() {
             public void actionPerformed(java.awt.event.ActionEvent evt) {
               saveSegmentModeActionPerformed(evt);
            org.jdesktop.layout.GroupLayout textPanelLayout = new org.jdesktop.layout.GroupLayout(textPanel);
            textPanel.setLayout(textPanelLayout);
            textPanelLayout.setHorizontalGroup(
                textPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(textPanelLayout.createSequentialGroup()
                  .addContainerGap()
                    .add(textPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 337, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .add(51,51,51)
                                .add(saveSegmentMode)
                                .addContainerGap(36, Short.MAX_VALUE)                               
           textPanelLayout.setVerticalGroup(
                textPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(textPanelLayout.createSequentialGroup()           
                .add(textPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(textPanelLayout.createSequentialGroup()
                            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 211, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(49, 49, 49)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
                        .add(textPanelLayout.createSequentialGroup()
                            .addContainerGap(43, Short.MAX_VALUE)
                            .add(saveSegmentMode)))
                    .addContainerGap(43, Short.MAX_VALUE))        
            showText.setText("Text");
            labelModes.setText("Modes: ");
            showStructure.setText("Structure");
            jTabbedPane.add(textPanel);
            jTabbedPane.setTitleAt(0,"Text");
            showStructure.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    showStructureActionPerformed(evt);
            textPane.addKeyListener(new java.awt.event.KeyAdapter() {
                public void keyTyped(java.awt.event.KeyEvent evt) {
                    textPaneKeyTyped(evt);
            textPane.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseClicked(java.awt.event.MouseEvent evt) {
                    textPaneMouseClicked(evt);
                   public void mouseEntered(java.awt.event.MouseEvent evt) {
                    textPaneMouseEntered(evt);
                    public void mouseExited(java.awt.event.MouseEvent evt) {
                    textPaneMouseExited(evt); 
            jScrollPane1.setViewportView(textPane);
            fileMenu.setText("File");
            loadRST.setText("Load RST file");
            loadRST.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    loadRSTActionPerformed(evt);
            fileMenu.add(loadRST);
            save.setText("Save RST");
            save.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    saveActionPerformed(evt);
            fileMenu.add(save);
            quit.setText("Quit");
            quit.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    quitActionPerformed(evt);
            fileMenu.add(quit);
            jMenuBar1.add(fileMenu);
            structureMenu.setText("Structure");
            jMenuBar1.add(structureMenu);
            setJMenuBar(jMenuBar1);
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
                    getContentPane().setLayout(layout);
                    layout.setHorizontalGroup(
                        layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(layout.createSequentialGroup()
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                .add(layout.createSequentialGroup()
                                    .add(26, 26, 26)
                                .add(layout.createSequentialGroup()
                                    .addContainerGap()
                                    .add(jTabbedPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                            .addContainerGap())
                    layout.setVerticalGroup(
                        layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                        .add(layout.createSequentialGroup()
                            .addContainerGap()
                            .add(23, 23, 23)
                            .add(jTabbedPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            textPane.setText("This seems to be an interesting exercise. I will surely learn swing now.");
            userText = new UserText(textPane.getText());
            pack();
            validate();
        private void saveSegmentModeActionPerformed(java.awt.event.ActionEvent evt) {                                               
            String textWithPipes= new String(textPane.getText());
            System.out.println("Text with pipes"+textWithPipes);
            userText.setUserText(textWithPipes);
            showStructure();
        private void showStructureActionPerformed(java.awt.event.ActionEvent evt) {
            showStructure();
        public void showStructure()
                 int count=0;
               int totcount=iconPositions.size();
               java.util.Iterator iter = iconPositions.iterator();
              store=new String[totcount];
              try
               String usertxt=userText.getTextWithSegment();
                      char[] usrtxt_chararr=usertxt.toCharArray();
                      System.out.println("Character array Usertextlength"+usrtxt_chararr.length);
                      int pt;
                      pt=0;
              while (iter.hasNext()) {
                          String obj=iter.next().toString();
                          int itervar=Integer.parseInt(obj);
              String subst=usertxt.substring(pt,itervar);   
              pt=itervar+1;
                store[count]=subst;
                 count++;
               catch(Exception e) {}
                   for(int i=0;i<store.length;i++)
                        System.out.println("Store Array Elements"+store);
    structureframe=new Rstmain.gui.ModifyS(store);
    structureframe.setVisible(true);
    jTabbedPane.add(structureframe); //Adding Structure frame
    jTabbedPane.setTitleAt(1,"Structure");
    validate();
    private void textPaneKeyTyped(java.awt.event.KeyEvent evt) {                                 
    if (segmentFlag){
    textPane.setEditable(false);
    private void textPaneMouseClicked(java.awt.event.MouseEvent evt) {                                     
    textPane.setEditable(true);
    int caretpos=textPane.getCaretPosition();
    System.out.println("Caret inserting positions"+caretpos);
    iconPositions.add(caretpos);
    // textPane.insertComponent(label_image);
    textPane.insertIcon(icon);
    textPane.setEditable(false);
    private void textPaneMouseEntered(java.awt.event.MouseEvent evt) {                                     
    private void textPaneMouseExited(java.awt.event.MouseEvent evt) {                                     
    setCursor(null);
    private void loadRSTActionPerformed(java.awt.event.ActionEvent evt) {                                       
    File file;
    SimpleInput sin;
    javax.swing.JFileChooser fd;
    fd = new javax.swing.JFileChooser(new File("."));
    fd.setDialogTitle("Open File...");
    int action = fd.showOpenDialog(this);
    if (action != javax.swing.JFileChooser.APPROVE_OPTION) {
    return;
    file = fd.getSelectedFile();
    try {
    sin = new SimpleInput(file);
    StringBuffer line = new StringBuffer("");
    textPane.setText("");
    while (!sin.eof()) {
    line.append(sin.readLine());
    textPane.setText(line.toString());
    textPane.setEditable(false);
    userText = new UserText(line.toString());
    catch (Exception e) {
    javax.swing.JOptionPane.showMessageDialog(this,
    "Sorry, some error occurred:\n" + e.getMessage());
    private void saveActionPerformed(java.awt.event.ActionEvent evt) {                                    
    File file;
    javax.swing.JFileChooser userFile;
    userFile = new javax.swing.JFileChooser(".");
    userFile.setDialogTitle("Save Text As...");
    int action = userFile.showSaveDialog(this);
    if (action != javax.swing.JFileChooser.APPROVE_OPTION) {
    return;
    file = userFile.getSelectedFile();
    if (file.exists()) {
    action = javax.swing.JOptionPane.showConfirmDialog(this,
    "Replace existing file?");
    if (action != javax.swing.JOptionPane.YES_OPTION)
    return;
    try {
    PrintWriter out = new PrintWriter(new FileWriter(file));
    String contents = textPane.getText();
    out.print(contents);
    if (out.checkError())
    throw new java.io.IOException("Error while writing to file.");
    out.close();
    catch (java.io.IOException e) {
    javax.swing.JOptionPane.showMessageDialog(this,
    "Sorry, an error has occurred:\n" + e.getMessage());
    private void quitActionPerformed(java.awt.event.ActionEvent evt) {                                    
    System.exit(0);
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    System.out.println("Inside run");
    new EditFormGui().setVisible(true);
    And this is the UserText classimport com.sun.org.apache.bcel.internal.classfile.JavaClass;
    public class UserText{
    int countpipe;
    String userText="";
    java.util.Vector segmentinfo = new java.util.Vector();
    public UserText(String input) {
    userText = input;
    public UserText(){}
    public int getNumberOfSegments()
    return segmentinfo.size();
    public void addSegment(int endIndex){
    int i = 0;
    segmentinfo.add(endIndex);
    public void setUserText(String textWithPipes)
    int indexOfPiping, j=0 ;
    StringBuffer temp = new StringBuffer(textWithPipes);
    segmentinfo.add(j);
    for (int i = 0; i < textWithPipes.length();i++)
    j = textWithPipes.indexOf('|',j);
    segmentinfo.add(j);
    for (int k = 0; k < textWithPipes.length();k++)
    if(textWithPipes.charAt(k)=='|')
    countpipe++;
    userText = temp.toString();
    public String getTextWithSegment(){
    return userText;
    public String getTextWithoutSegment(){
    java.util.StringTokenizer st = new java.util.StringTokenizer(userText,"|");
    StringBuffer temp = new StringBuffer();
    while(st.hasMoreTokens())
    temp.append(st.nextToken());
    return temp.toString();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

  • ADF Swing LOV problem

    Hi,
    I created an application using ADF Swing with JDeveloper version 10.1.3.2.0.4066.
    I made a form contains JTable and Edit Form which using some LOVs to insert or update data. Something weird happen when user insert data using LOV.
    Scenario:
    1. firstly, JTable contains some data, let say 5 records.
    2. User want to input some new data (the sixth record), then user push (+) button in JUNavigationBar, then one new record is added into JTable
    3. User want to edit the new record, then user push Edit button which will display Edit Form
    4. User push button which will display LOV to insert the correct record, after selecting a record from LOV then user push OK button from LOV form, then LOV form will be closed.
    5. User performing commit to permanently save data to database.
    now, the weird part:
    6. User want to input the second record, then user push (+) button in JUNavigationBar, then one new record (the seventh record) is added into JTable
    7. User want to edit the new record, then user push Edit button which will display Edit Form
    8. User push button which will display LOV to insert the correct record, after selecting a record from LOV then user push OK button from LOV form, hoping that LOV form will close but NOT. User need to push OK button twice to make the LOV Form closed.
    so that is the weird thing, if user input the third record (the eighth record), then user need to push OK button three times to make the LOV Form being closed, if user input 100 record then user need to push OK button 100 times to close LOV Form. Weird?
    but if user close the main form first, then display the form again and input the new record using LOV (the seventh record), the weird thing is not gonna happen.
    how I can solve this weird thing?
    thanks

    below is step by step creation of ADF Form and how the error happened and handled (using Oracle JDeveloper 10.1.3.3.0.4157) :
    1. create database connection using JDeveloper wizard.
    a. supply connection name: dbscott
    b. supply username: scott, password: tiger, deploy password is checked.
    c. Driver: thin, hostname, JDBC Port, and SID as installed
    d. test connection: sucess
    2. from JDeveloper, open Application Navigator and then create new application:
    a. application name: ScottApp
    b. application path: default
    c. application package prefix: test.scott
    d. application template: [Swing, ADF BC]
    e. OK button pushed
    3. now, configuring Oracle Business Component:
    a. from Model project, right click and select New
    b. select ADF business component from business tier and select Business Components from tables on the right pane
    c. click OK
    d. select dbscott on the connection option. SQL Flavor and Type MAp: default
    e. click OK
    f. with only object type table is selected, shuttle all table object into selected pane and specify package to test.scott.model.entities
    g. click next
    h. shuttle all object into selected pane and specify package to test.scott.model.queries
    i. click next twice
    j. specify application module: ScottModule
    k. click next and then finish
    4. now, creating ADF Form object
    a. on the View Project, right click and select New
    b. select ADF Swing on the client tier and empty form on the right pane
    c. click OK
    d. supply form name: EmpForm, generate menu bar and generate login dialog option is unselected
    e. click next and then finish
    f. then JDeveloper will display its excellent Swing Editor, select JUNavigationBar on the EmpForm and then delete
    g. click form EmpForm and on data Panel specify layout to FormLayout
    h. on the FormLayout popo up menu, specify rows to 8 and columns to 3, insert gap is selected, click OK of course.
    i. on the data control palette, drag and drop EmpView1 to the first rows and column, then on the Add Child menu select Navigation Bar
    j. select NavigationBar, on the blue point, drag to the third column. right click NavigationBar, select Column Properties menu and click grow. then OK
    k. on the component palette, select Swing Container, drag and drop JScrollPane to the second row and first column
    l. with JScrollPane selected, on the blue point drag JScrollPane so its covers second to seventh row and first to third column
    m. right click on JScrollPane, select Row Properties menu and select Grow. click OK then
    n. on the Data Controls palette, drag and drop EmpView1 to JScrollPane, on the Add Child menu select table.
    5. now, creating ADF Edit Form object:
    a. rigth click on the View Object, select New
    b. select ADF Swing on the client tier and select Empty Panel on the right pane.
    c. Panel name: EditEmpForm, other option default
    d. click next and finish
    e. then JDeveloper will display EditEmpForm editor
    f. on the Data Controls palette, drag and drop EmpView1 to EditEmpForm then select Add Edit Form
    g. then Select Contrl window will be displayed. Click new to add LOV for Deptno
    h. new attribute will be added on the bottom, change attribute to Deptno and its control to Button LOV. create label option for this attribute is unselected.
    i. click OK
    j. adjust width and height the new panel created by JDeveloper properly
    k. in the Application Navigator, double click PanelEmpView1Helper, supply text for Deptno LOV JButton.
    6. configuring Deptno LOV JButton:
    a. with LOV JButton is selected, select model in its property inspector, then model window will be displayed
    b. LOV Update Attribute Tab is active, in Lov (source) Data Collection Pane, select DeptView1 and click New buttion below to create new iterator, click OK to create new iterator for DeptView1.
    c. click add button to add LOV attributes
    d. select deptno in the LOV Attributes and select Deptno in the target attributes.
    c. select LOV Display Attributes, shuttle all attributes to the right pane.
    d. click OK to finish configuring LOV
    7. adding EditEmpForm to EmpForm:
    a. with Empform is active in the editor, from Application Navigator drag and drop EditEmpForm.java to the last row on the first column of EmpForm.
    b. Select Option window will be displayed, select Display Panel in JDialog and Invoke JDialog from Button option is selected
    c. then a JButton will be added to last row on the first colum of EmpForm. Adjust this button to be displayed properly
    Then the creation of ADF Form is complete. We're able to create this powerful form with NO CUSTOM PROGRAMMING AT ALL, it's all because of Oracle ADF. But wait... we will run this scenario to perform how the error happen.
    Assumption, a user want to perform edit and insert data on EmpForm. He will perform following task:
    a. Run EmpForm, then the form will be displayed at runtime.
    b. The user want to edit data first, so he select a row then click Edit button, then EditEmpForm will be displayed.
    c. user edit one or more data, displaying LOV to edit Deptno. at this time, he just need to push OK button at LOV Form once. After completing edit, user close EditEmpForm by clicking OK button, EditEmpForm will be closed.
    d. now, user want to insert new record, simply at EmpForm user click (+) button at navigation bar to create new record, user click Edit button to display EditEmpForm, the user filling new information and of course diplaying LOV to select Deptno, now user need to click OK button in LOV form TWICE to be able to close the LOV Form. The user then click OK button to close EditEmpForm and back to EmpForm.
    e. The user think that just intermittent error, now he want to update data again. So, he do perfectly the same step before but now he need to click OK button from LOV Form THREE TIMES to close LOV Form. The user then click OK button to close EditEmpForm and back to EmpForm.
    f. after thinking hardly why this happened to him, the user then performing commit transaction then close EmpForm and open again.
    g. now user perform update data again but this time he just need to click OK button from LOV form once.
    The above error will not happened if the user open EditEmpForm just once ! if he close and open again EditEmpForm then he need to click and click OK button from LOV Form as many as he open EditEmpForm.
    I don't know why this happen, if something not right from how I create the application which causing this error, please let me know.
    regards,
    wong jowo

  • Auto refresh facility is there in ADF swings?

    Suppose i am displaying data from the data base using updateable or read only view. If any record is updated or inserted on back end this should reflect on the front end. How achieve this in ADF swings.
    Auto refresh facility is there in ADF swings?

    Hi,
    if the update is in the database then there is no notification to the Swing client to refresh. In JDeveloper 11 this will become possible with the new Oracle DB 11 JDBC driver. If you needed this functionality then you either need to frequently re-query or use other mechanisms like Adavanced Queueing in the database
    Frank

  • Creating tables ADF/Swing

    Hello
    does anybody know the path to creating tables in ADF? it would have to be those with Headings for column sorting, row selection and the 3 standard buttons for insert, update, delete.
    I am reading and reading and they say they come pre-made, I created a table but it has none of the features I mentioned. I m trying to translate my web app into a desktop. I have separated the 2 projects, the DataModel with the Business Logic and now I am onto the GUI creation, though, ...stuck.
    Thanks a lot
    Message was edited by:
    AlvaroEP
    Message was edited by:
    AlvaroEP

    Hello,
    I think you are looking for a Junavigation bar, Which contains the standard buttons Insert record, Delete record, commit , rollback..
    In Componets... You need to select the "ADF Swing Controls"
    It will show you the different options... In that select the Junavigation bar and place it in your panel.
    Thanks,
    Guruprasad K

  • A Simple Question... inserting image into JTextPane...

    Well my problem is very simple (but not for me). Before I explain it, please take a look at a simple class...
    public class Window extends JTextPane {
        Window() {
            super();
        }// Window
        public void appendText(String s,Color col) throws BadLocationException {
            StyledDocument sd = getStyledDocument();
            SimpleAttributeSet attr = new SimpleAttributeSet();
            StyleConstants.setForeground(attr,col);
            sd.insertString(sd.getLength(),s,attr);
          *     THE POINT - what should I write here, please consult description followed by the class.
        } //appendText
    } //classThe appendText method simply appends the text in text pane with desired color. Now I want to know what should I write at point THE POINT so that at end of appended string an icon (suppose end.gif) is added and is displayed in text pane. Simple?
    Stay happy,
    fadee

    Dear Fadee,
    here is a small programe for inserting images into JTextPane;
    find this comment and start
    /*All Code In this Button Action*/if you need any thing feel free to tell me,
    i'm with you brother, i'll do my best :O)
    -Best regards
    mnmmm
    * Fadee.java
    * Created on June 7, 2002, 1:13 AM
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.color.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    * @author  Brother Mohammad, Cairo, Egypt.
    * @version
    public class Fadee extends javax.swing.JFrame {
        JTextPane   tp;
        JButton     b;
        StyledDocument sd;
        SimpleAttributeSet attr;
        public Fadee() throws BadLocationException {
            b = new JButton("Press");
            tp = new JTextPane();
            b.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    /*All Code In this Button Action*/
                    try {
                        sd = tp.getStyledDocument();
                        attr = new SimpleAttributeSet();
                        /*get default style*/
                        Style def = StyleContext.getDefaultStyleContext().
                                            getStyle(StyleContext.DEFAULT_STYLE);
                        /*add style for text default style*/
                        Style regular = tp.addStyle("regular", def);
                        StyleConstants.setFontFamily(def, "SansSerif");
                        StyleConstants.setAlignment(def, StyleConstants.ALIGN_CENTER);
                        StyleConstants.setForeground(def, Color.RED);
                        /*add style for icon create as many as icons you have
                         and don't forget to resize the photo at small size
                         to fit with font size*/
                        Style s = tp.addStyle("icon", regular);
                        StyleConstants.setAlignment(s, StyleConstants.ALIGN_JUSTIFIED);
                        StyleConstants.setIcon(s, new ImageIcon("d:\\My Photo.GIF"));
                        /*here is what user will see*/
                        sd.insertString(sd.getLength(), "Allah Akbar ", tp.getStyle("regular"));
                        sd.insertString(sd.getLength(), " ", tp.getStyle("icon"));
                    } catch (BadLocationException x) {
                        x.printStackTrace();
            getContentPane().setLayout(new BorderLayout());
            getContentPane().add(b, BorderLayout.NORTH);
            getContentPane().add(tp, BorderLayout.CENTER);
            setSize(500, 500);
            setVisible(true);
        public static void main(String args[]) {
            try {
                Fadee f = new Fadee();
            } catch (BadLocationException x) {
                x.printStackTrace();
    }

  • Deploying a BC4/ADF Swing Application to a JAR File

    Hello,
    what do I exactly have to do, to deploy an ADF/Swing/Business Components-
    Project-Application to a JAR File. I can not start it outside the JDevloper IDE,
    but I created a deployment profile and deployed it to a JAR.
    There is always the error "Could not find the main class", when starting the
    JAR. In the JDeveloper IDE the application is running, and I also defined a "main class" there.
    Could anybody help me please?
    Greetings.

    You need the ADF runtime libraries in your classpath or as part of your JAR.
    Have a look at the command that JDeveloper is using to run your project (it is in the log window) and copy the classpath defenition provided there to the command line you use.

  • Using local/testing server with cs5 inserting images look fine in the split screen but do not show

    Hi
    If I open example: header.php and insert any photo jpeg/.html ecs i can see the images in the split screen but not in the browser if i save then refresh. I am able to make any change to the code ecs. and they are reflected just fine. I have tried this with my fireworks images .html and when that did not work i tried a strait jpeg off the desktop. This all did not work. I have deleted the local server then step by step created a new one via devnet instruction. This did not work! everything looks fine i even tried in 3 sep browsers with 0 luck....There is no remote server connected at this time because i am making a child theme for my current site. After all changes are done we will the ftp the word press files to site and change.
    Ps i even started over from scratch with 0 positive affects....

    After a lot of pain!!!!!!! the issue is fixed lol After 3 weeks I have overlooked the obvious !!! so the simple fix was the path of the image. Yes i feel stupid 10 years in lol....
    Apparently dreamweaver cs 5 will not use the full path when inserting images into the page example: If you drag the image out of your assets folder or however you do it, DW will give you a path like this <img src="images/glass.jpg" width="800" height="729"> This is not the full path and when your pist!!! you cant see things like that ;( so the image path should look like this:
    <img src="wp-content/themes/adszoom/images/glass.jpg" width="800" height="729">
    also in the html files example of bad then good!
    <!--======================== BEGIN COPYING THE HTML HERE ==========================-->
    <img name="navigation" src="navigation.gif" width="1000" height="50" border="0" usemap="#m_navigation" alt="">
    <map name="m_navigation">
      <area shape="poly" coords="804,7,994,7,994,47,804,47,804,7" href="http://adszoom.com/699-2/" title="SEARCH BY CATEGORIES FOR CLASSIFIED ADS" alt="SEARCH BY CATEGORIES FOR CLASSIFIED ADS" >
      <area shape="poly" coords="602,8,792,8,792,48,602,48,602,8" href="http://adszoom.com/wp-admin/edit.php/" title="VIEW OR EDIT YOUR CLASSIFIED ADS" alt="VIEW OR EDIT YOUR CLASSIFIED ADS" >
      <area shape="poly" coords="405,8,595,8,595,48,405,48,405,8" href="http://adszoom.com/post-an-ad/" title="NEW CLASSIFIED AD POST" alt="NEW CLASSIFIED AD POST" >
      <area shape="poly" coords="206,8,396,8,396,48,206,48,206,8" href="http://adszoom.com/help/" title="HELP WITH YOUR CLASSIFIED ADS" alt="HELP WITH YOUR CLASSIFIED ADS" >
      <area shape="poly" coords="3,9,193,9,193,49,3,49,3,9" href="http://adszoom.com/" title="HOME VIEW CLASSIFIED ADS" alt="HOME VIEW CLASSIFIED ADS" >
    </map>
    <!--========================= STOP COPYING THE HTML HERE =========================-->
    </body>
    NOW THE GOOD!
    <!--======================== BEGIN COPYING THE HTML HERE ==========================-->
    <img name="navigation" src="wp-content/themes/adszoom/images/navigation.gif" width="1000" height="50" border="0" usemap="#m_navigation" alt="">
    <map name="m_navigation">
      <area shape="poly" coords="804,7,994,7,994,47,804,47,804,7" href="http://adszoom.com/699-2/" title="SEARCH BY CATEGORIES FOR CLASSIFIED ADS" alt="SEARCH BY CATEGORIES FOR CLASSIFIED ADS" >
      <area shape="poly" coords="602,8,792,8,792,48,602,48,602,8" href="http://adszoom.com/wp-admin/edit.php/" title="VIEW OR EDIT YOUR CLASSIFIED ADS" alt="VIEW OR EDIT YOUR CLASSIFIED ADS" >
      <area shape="poly" coords="405,8,595,8,595,48,405,48,405,8" href="http://adszoom.com/post-an-ad/" title="NEW CLASSIFIED AD POST" alt="NEW CLASSIFIED AD POST" >
      <area shape="poly" coords="206,8,396,8,396,48,206,48,206,8" href="http://adszoom.com/help/" title="HELP WITH YOUR CLASSIFIED ADS" alt="HELP WITH YOUR CLASSIFIED ADS" >
      <area shape="poly" coords="3,9,193,9,193,49,3,49,3,9" href="http://adszoom.com/" title="HOME VIEW CLASSIFIED ADS" alt="HOME VIEW CLASSIFIED ADS" >
    </map>
    <!--========================= STOP COPYING THE HTML HERE =========================-->
    </body>
    THIS LINE IS YOUR ISSUE
    <img name="navigation" src="wp-content/themes/adszoom/images/navigation.gif" width="1000" height="50" border="0" usemap="#m_navigation" alt="">
    Ok thanks and if there are any issues with dw please ask: [email protected]

  • Problem with "find" mode in adf/swing application

    Hi all,
    I'm working on ADF Swing application which uses MS SQL Server 2005 (JDeveloper 10g 10.1.3)
    I think that my issue might be well-known…sorry if it has been already discussed somewhere else…
    I have a problem with the “find” mode for a detail panel in a master-detail form…(To make it clear the “find” mode is switched on when clicking on the special button on a navigation panel).
    So this mode works well in a master panel, but it demonstrates strange behavior on a detail panel, i.e. it takes me two attempts to find the necessary child object and it doesn’t switch back in a simple way from this mode to the normal mode….say if we are in the department 10 (Dept is a master form) we can’t simply find KING employee (Emp is a detail form)…is there any workaround for this?
    Thanks in advance. Alex.

    Hi Frank, please look this issue

  • How to validate in ADF Swing application

    I created an app using ADF Swing:Holiday. My table is Holiday has: HolidayID, Holiday, Reason, Desc. I only want to show Holiday, Reason, Desc. Holiday is Date type. Now I want to validate if user type an ilegal format date?

    Are you using application express?
    For ADF try the JDev discussion forum.
    JDeveloper and ADF

Maybe you are looking for

  • Error while Posting Payroll

    Hello ,           While  execute posting  run  Payroll . i am getting the error bellow, Posting balance is not cleared (Period 05 / 2007 A) Message no. 3G103 Diagnosis The employee has been rejected because the balance of the generated posting items

  • My old laptop died.  How do I get my library off my nano and onto the new computer?

    My old laptop died.  How do I get my library off my 5th generation nano and onto the new laptop?

  • Upload vendor master data long texts to CRM

    Hi I do have the same problem of this thread: [CRM Middleware - R3 to CRM - Long Text transfer |CRM Middleware - R3 to CRM - Long Text transfer] Does anyone know how to upload long texts of Vendor master data to Business Partner mater data? Thanks in

  • To capture all the objects from an tablespace and restore.

    Hi All, I have a situation in the  Schema  refresh process where i may have  to delete a tablespace  and its datafiles. Then I have to recreate it as it was before and restore all it objects . Is there any way that i can capture all the objects of th

  • Can I buy back my iPad?

    I bought my iPad in December and now the new one came out. Can I trade mine in for that one?