Problem displaying panel into frame
i have a GUI which uses the following frame, the frame
displays two panels,i set fallPanel's width and height to
some values but when i run the program i see just a
small square inside my
frame instead of a my
dimensioned fallPanel, could any java guru help me?
(i post the code for the frame too)
thanx
clo
public class FallFrame extends JFrame
private Container contentPane;
private GridBagLayout layout = new GridBagLayout();
public FallFrame()
FallPanel fallPanel = new FallPanel();
SidePanel sidePanel = new SidePanel();
contentPane = getContentPane();
contentPane.setLayout(layout);
GridBagConstraints constraints = new GridBagConstraints();
constraints.weightx = 0;
constraints.weighty = 0;
add(fallPanel, constraints, 0, 0, 1, 1);
add(sidePanel, constraints, 1, 0, 1, 1);
repaint();
private void add(Component c, GridBagConstraints
constraints,
int x, int y, int w, int h)
constraints.gridx = x;
constraints.gridy = y;
constraints.gridwidth = w;
constraints.gridheight = h;
contentPane.add(c, constraints);
If you're only using 2 panels, ditch the use of GridBagLayout. It's not very easy to use, and can be quite tricky if you don't set the parameters the way it expects them. In particular, weightx, and weighty are important parameters, and not setting them or setting them incorrectly can cause your components to collapse when the frame is resized.
If you just have two panels, use BorderLayout. It's much more simple, and I use it almost all the time. Rarely, is there a need for the complexity of GridBagLayout.
public class FallFrame extends JFrame {
public FallFrame() {
getContentPane().setLayout( new BorderLayout() );
FallPanel fallPanel = new FallPanel();
SidePanel sidePanel = new SidePanel();
getContentPane().add( fallPanel, BorderLayout.WEST );
getContentPane().add( sidePanel, BorderLayout.CENTER );
One note of caution. Adding the component into the CENTER of BorderLayout will cause it to get all the resize. If you want fallPanel, and sidePanel to share that you can add sidePanel to the EAST instead of the CENTER, and resize will redistribute more evenly. If you have any trouble with BorderLayout read the APIs.
charlie
Similar Messages
-
Can I place a 13" retina display panel into my 2011 MBP?
I was wondering (moreso wishing and hoping) if it's possible to have my 2011 MBP display panel replaced with the recent 13" retina display panel. My 2011 MBP is just out of warranty and its display panel has developed a green line issue that seems too common among MBP displays.
Thanks!The best option would be to take this to Apple and pay for it to be fixed. The display will be expensive to fix, so if you feel you can, purchasing a replacement from eBay or somewhere online would be possible. You can not fit a Retina display on as the hings and connectors are different, and even if they were not, the firmware and drivers your Mac will have (and continue to have as the model number tells the system you should have a standard display) can not drive the higher resolution efficiently. This would lead to performance and battery issues.
Consider buying a desktop stand and display for your Mac as well and use the built in display only when necessary. Small problems with LCDs usually develop into worse situations quickly.
Good luck! -
Hi Everybody !! I am new to Swing and am working on a GUI based Elevator Simulation System. I am using Frame on which I am trying to put a Panel. But the panel does not set to the size I want it to even if I use setSize() method. I am posting the code .Could anyone please help me.
Thanks !!
package elevator;
import javax.swing.*;
import java.awt.*;
public class Controller {
public static void main(String args[])
Container cpane;
JFrame frame = new JFrame("ELEVATOR");
cpane = frame.getContentPane();
Lift1Panel lp1 = new Lift1Panel();
frame.setVisible(true);
frame.setSize(1300,800);
frame.add(lp1);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
package elevator;
import javax.swing.*;
import java.awt.*;
public class Lift1Panel extends JPanel {
public Lift1Panel()
setSize(200,200);
public void paintComponent(Graphics g)
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
g2d.setColor(Color.WHITE);
g2d.drawRect(10,10,100,100);
}if you use setPreferredSize, don't forget to call frame.pack();. Also, you must realize that the default layout for the contentPane is the BorderLayout, and the default location for adding to this is the BorderLayout.CENTER position. At this location, setPreferredSize is ignored and the central component is expanded to fill the region. You may wish to use a different layout such as the FlowLayout. Experiment with this.
-
Background picture n problem on display other JInternal frame
beginer;
this is my code below n i compile it n the picture display correctly, but it seems to hide other internal frame as well, what wrong with my code :(, the problem is been specified between ? symbols
public class InternalFrameDemo extends JFrame implements ActionListener {
JDesktopPane desktop;
public InternalFrameDemo() {
super("InternalFrameDemo");
int inset = 50;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(inset, inset,
screenSize.width - inset*2,
screenSize.height - inset*2);
Toolkit kit = Toolkit.getDefaultToolkit();
Image icon = kit.getImage("ADD.gif");
setIconImage(icon);
//Set up the GUI.
desktop = new JDesktopPane(); //a specialized layered pane
createFrame(); //create first "window"
setContentPane(desktop);
setJMenuBar(createMenuBar());
//Make dragging a little faster but perhaps uglier.
desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
ImageIcon image = new ImageIcon("abc.jpg");
JLabel background = new JLabel(image);
background.setBounds(0, 0, image.getIconWidth(), image.getIconHeight());
getLayeredPane().add(background, new Integer(Integer.MIN_VALUE) );
JPanel panel = new JPanel();
panel.setOpaque(false);
setContentPane( panel );
protected JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar();
//Set up the menu item
return menuBar;
public void actionPerformed(ActionEvent e) {
else {
quit();
protected void createFrame() {
Books frame = new Books();
frame.setVisible(true);
desktop.add(frame);
try {
frame.setSelected(true);
catch (java.beans.PropertyVetoException e) {}
protected void quit() {
System.exit(0);
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
catch (Exception e) {
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
InternalFrameDemo frame = new InternalFrameDemo();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Display the window.
frame.setVisible(true);
tanz.This might be what you are trying to do:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.*;
public class TestInternalFrame extends JFrame
ImageIcon icon;
public TestInternalFrame()
icon = new ImageIcon("????.jpg");
JDesktopPane desktop = new JDesktopPane()
public void paintComponent(Graphics g)
Dimension d = getSize();
g.drawImage(icon.getImage(), 0, 0, d.width, d.height, null);
getContentPane().add( desktop );
final JInternalFrame internal =
new JInternalFrame( "Internal Frame", true, true, true, true );
desktop.add( internal );
internal.setLocation( 50, 50 );
internal.setSize( 300, 300 );
internal.setVisible( true );
public static void main(String args[])
TestInternalFrame frame = new TestInternalFrame();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.setSize(400, 400);
frame.setVisible(true);
} -
So, I've got a little problem with the display.
I've mage a GUI with a frame and all is ok.
The main calls a methods which does a lot of things and after calls an other class which has to display a frame where I draw some lines thanks to paint.
the problem is that in the second frame, the content of the first is shown and on the content there are my paints. Does anyone know how to solve this problem in order that in the second frame , there is just my paint. (Because in the second frame, we see just the content, the buttons and all the things aren't ok.... and if I change the size of the second frame, there are a lot of stange things with the display of this frame...)
Thanks..
KanawebSo here is some parts of my code.
My main class is UWB( )
It's like that :
package uwbrelease2;
import javax.swing.UIManager;
import java.awt.*;
import java.util.*;
public class Uwb
//declaration d'une variable de test pour lancer cadre
boolean packFrame = false;
// debut du constructeur
public Uwb()
Frame1 frame = new Frame1();
if (packFrame) {frame.pack();}
else {frame.validate();}
//Centrer la fen?tre
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
frame.setVisible(true);
} // fin du constructeur
//m?thode principale
public static void main(String[] args)
try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
catch (Exception e) { e.printStackTrace(); }
new Uwb();
Simulation simu = new Simulation();
}//fin m?thode principale
}//fin class uwb[\code]
Here are some parts of Frame1( ) :[\b]
package uwbrelease2;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.*;
public class Frame1 extends JFrame {
//Main UI panel
JPanel contentPane;
//Radio buttons that control the current panel
JRadioButton Panel1Radio = new JRadioButton();
JRadioButton Panel2Radio = new JRadioButton();
JRadioButton Panel3Radio = new JRadioButton();
ButtonGroup buttonGroup1 = new ButtonGroup();
//Combo box and list of items that control the current panel
Object[] dataObject = {"1 cm", "10 cm", "50 cm"};
JComboBox jComboBox1 = new JComboBox(dataObject);
//Card layout container panel
JPanel jPanel1 = new JPanel();
CardLayout cardLayout1 = new CardLayout();
//Card layout panels and layouts
JPanel jPanel2 = new JPanel();
JPanel jPanel3 = new JPanel();
JPanel jPanel4 = new JPanel();
GridBagLayout gridBagLayout1_panel3 = new GridBagLayout();
FlowLayout flowLayout1_panel4 = new FlowLayout();
.............................. and so on......
[\code]
Here is some part of simulation( ) :[\b]
package uwbrelease2;
import java.util.*;
import java.awt.*;
import java.io.*;
public class Simulation
//constructeur pour cr?er un objet Simulation
public Simulation()
try {
doSimulation();
catch (IOException ex) {
public void doSimulation() throws IOException {
ZoneGraphique zone=new ZoneGraphique(tabMur);
//zone.validate();
zone.show();
where tabMur is an ArrayList .....[\b]
[\code]
[b]and finally here is ZoneGraphique ( ):[\b]
package uwbrelease2;
import javax.swing.*;
import java.awt.*;
import java.util.*;
public class ZoneGraphique extends JFrame {
public ArrayList tabMur;
public ZoneGraphique(ArrayList tabMur1) {
super("visualisation");
tabMur = tabMur1;
setSize(500,500);
try {
DoZoneGraphique zone = new DoZoneGraphique();
getContentPane().add(zone);
catch (Exception e) {
e.printStackTrace();
class DoZoneGraphique extends JPanel {
public void paintComponent(Graphics comp){
Graphics2D comp2D=(Graphics2D)comp;
comp2D.setColor(Color.RED);
comp2D.drawString("Floride",20,20);
for (int j=0;j<=tabMur.size()-1;j++)
Mur mur = (Mur)tabMur.get(j);
comp2D.drawLine((int)mur.getAbs1(),(int)mur.getOrd1(),(int)mur.getAbs2(),(int)mur.getOrd2());
[\code]
So if you can help me, thanks .....[\b] -
Problem converting Word '07 into Frame
I have a document that needs to go into Frame. I have tried opening the .docx file with frame maker, as has been suggested on other websites, and the document opened with no formatting and the majority of the information missing. Is there a way to open the word document, while retaining the formatting, into Frame for editing?
Because you don't supply any details of your Frame install, it's hard to be specific with recommendations.
You may want to follow up on those "other websites" to find out how they did it.
But in general terms without knowing what version you're working with, the usually preferred method is to, from Word, SaveAs .rtf and open the .rtf in Frame.
You may also be able to copy in Word and then Paste Special as RTF in Frame.
In either case, plan on saving the FM file as MIF to remove hidden Word characters that can cause problems later.
Then open the MIF file, save that as FM and go on...
Art -
I was reading an online article about using iWeb
http://www.mymac.com/showarticle.php?id=3047
and there is a screen shot of the font display panel
This is the panel many applications use to allow the user to adjust the fonts. If you open TextEdit and go to Format/Font/Show Font the Font Panel will appear.
As you can see in the iWeb article the screen shot shows recently used fonts. The fonts show how they actually appear or they are preview. When I bring up iWeb o TextEdit I don't see that preview. If I select the Gear icon in the lower left corner I can turn on Show Preview but this just brings up a header show what a selected font looks like. The fonts in the list don't change.
There seems to be a problem with my Recently Used and Favorite lists. There are a few fonts in my list but they are not grouped together. There are blank rows listed between the shown fonts. However if I click in the blank area a font is selected and if you have any text selected in the document it will change that text.
If I choose a new font for a TextEdit document that font never shows up in the Recently Used list.
Is there a preference file for this panel? It appears my font display panel is not working correctly.
Are others having these issues?
Thanks
Kelvin
Message was edited by: KRitchieI have an iBook running 10.4.11 and the recently used collections gets updated correctly. However when adding a font to the the Favorites collection there are blank rows between the fonts I've added. Also if you select the font type and not the specific font such as the bold, or regular it doesn't copy all of them.
Also, unlike in Leopard when you select the Recently Used collection you see what the font looks like show in the list irrespective if the preview panel is activated. Looks like for Leopard the font display panel was changed or not tested thoroughly.
Kelvin
Message was edited by: KRitchie -
I have an application which collects data from several sources, displays the data on multiple panels, and writes the data to disk. This program also uses the CIVIC Web Server. The program has run correctly for days and even weeks. Eventually the display panels all go blank. The panels are still there but contain only white space. The collection and writing of data to disk, however, continues. When the program is stopped (from the task bar or task manager) and restarted, it performs normally again.
Has anyone else seen this kind of behavior? I suspect that it might have something to do with the web server, but I have another very similar program running on a different PC also using the web server. This program does not have the blank screen problem.
Thanjs for any light you can shed on this.
Bruce AndrewsHello Judy -
I recently saw this in a CVI program I had written, and in my case, the cause was a memory leak in my program. If you open task manager when you see this white screen, how much memory is the CVI application using??
I would also make sure you've enabled extended debugging on your development machine in debug mode, which should show you any memory leaks you may have. Just enable extended debugging through the Options»Build Options dialog, and then run your program under the debugger. You should allow the program to exit normally. If the Resource Tracking window then displays, it is an indication of resources that need to be cleaned up. For more information, refer to this document.
NickB
National Instruments -
I am using ITunes 11.05.5 on Windows 7 Professional. Have thousands of videos ... MP4 Music Videos. I make my own "ARTWORK" (on JPG per artist for all music videos by that artist). I place the artwork in the file by "GET INFO", "ARTWORK", copy in my own JPG Image. I confirm that there is only one image in the ARTWORK and that it is the correct image. When I save and go back to the GET INFO everthing is fine. When I view it in MS Explorer or in ID3-TAG the ARTWORK is also fine. This process works fine for most everything but unexplainably fails and I can't fix it on certain occasions.
THE FAILURE: Let me explain the problem that occurs on rare occasions (and once it occurs I can't ever fix it). Lets say I have 5 music videos from the artist, John Jones. I embed my own artwork (the same ARTWORK for all music videos from this same artist, John Jones) and all five videos group under the proper. same ARTWORK in the GRID VIEW. Now, I obtain another music video from John Jones, once again I put the same ARTWORK on this file and now when I go into GRID VIEW it displays a POSTER FRAME (of that artist, John Jones) that I have never seen (although it must have come from the video since it is a POSTER FRAME of John Jones) ..... from that point on, all six music videos from John Jones also display that same ARTWORK (the wrong poster frame - but same poster frame for all John Jones music videos) even tho the first five were displaying properly before (but not longer). It is as if a POSTER FRAME of John Jones is in cache and associated with the artist John Jones and can not be deleted.
I have tried uninstalling and reinstalling ITunes, but it doesn't work. I have tried deleting the new Music Video that I added and that started the problem (number six); hoping the the original five would return to nomal ... but that does not work.
Any suggestions would be appreciated.this one is actually a really rare symptom of a flaky connection to the ipod on a Windows PC. there's more going on in terms of hardware on nanos and 5th gens than in the earlier models ... so if the connection is flaky to precisely the right/wrong degree, itunes will see the ipod, but misidentify it as an earlier version of ipod.
tracking down the cause of the flakiness can be tricky ... as you already know ...
just checking. have you tried connecting with a different (known-good) USB cable? does that seem to have any impact on the rate of occurence of the problem? -
Content cannot be displayed in a frame
Hi there,
I need your help as this is the first time I have run a server and Apple Care seems to be stumped by the issue. I am a complete novice at this.
I decided to set up my own server to host email and my website. I have two domaine names: jeffhargrove.com and jeffhargrove.net.
I set up the server for email and webservices for jeffhargrove.com. Then to test if everything was working, I first changed the dns of my .net domain to point to my server. I specified that jeffhargrove.net and www.jeffhargrove.net were alias of jeffhargrove.com.
Under this configuration, email and the site www.jeffhargrove.net worked fine. I changed some text in one of the html files on my server to make sure that the site was loading off my server. It was.
As everything was working, I then pointed jeffhargrove.com domain to my server. Email works fine and any mail that is addressed to jeffhargrove.net arrives in my jeffhargrove.com inbox. Mail alias seems to be working.
www.jeffhargrove.com works fine, but www.jeffhargrove.net works partially. Pages load until there is a reference to "http://wwww.jeffhargrove.com/portfolios/.…html" This reference appears because iWeb uses an iFrame to load a slideshow that I created for my site. In Safari, the frame just does not load and there is an empty space where the slide show should be. In Firefox, it returns the message:
This content cannot be displayed in a frame
To protect your security, the publisher of this content does not allow it to be displayed in a frame.
Apple Care did not know of any setting on the server that would prevent this from happening. The rep did not know about Apache modules which he said might be able to enable loading content in frames. I checked out the different modules available and cannot seem to find one that might resolve the issue. The rep did have me check all the permissions on all my web files and they seem correct.
Would you happen to have any idea what might be causing this issue. My site was hosted on a commercial server service with the same files and same alias and worked fine. This leads me to believe that there is a setting on mac os x server that is preventing content in frames to be displayed.
Thanks for any help you might offer!
JeffApple Care called me back and gave me a solution to the problem after the tech researched a bit.
New server software (from what version I do not know) changed the default display option of content in frames. By default it is blocked. There is no option to change this in the UI. The change has to done in an Apache config file. Here are the steps:
First stop your web service in Server Admin from your admin account, then:
1. Log into your server as root.
2.In the finder, pull down the "go" menu and select "go to folder.."
3.Type "/etc"
4. Look for a folder called "apache2" and open it.
5. duplicate a file called "httpdteamsrequired.conf" by renaming it or moving it to the desktop
6. Open the file in TextEdit
7. Find the string "x-frame-options"
8. It will be located in a three line paragraph which begins with "<IfModule…." and ends with "</IfModule"
9.Place a pound sign (#) at the beginning of each of the three lines.
10. Save
11 logout of root
12 login into your admin account and restart web services in server admin
Problem should be fixed.
Jeff -
1
I Have Problem in display data into Chart Or chartJs ,
In my Controller I Return Json and
use it in javascript like this but i have
error that tell me 't' is undefined
$(document).ready(function () {
$.getJSON("/Report/GetTransactions/", function (data) {
debugger;
var ctx = document.getElementById("myChart").getContext("2d");
var myBarChart = new Chart(ctx).Bar(data);
debugger;
data = {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
label: "My First dataset",
fillColor: "rgba(220,220,220,0.5)",
strokeColor: "rgba(220,220,220,0.8)",
highlightFill: "rgba(220,220,220,0.75)",
highlightStroke: "rgba(220,220,220,1)",
data: [data]
label: "My Second dataset",
fillColor: "rgba(151,187,205,0.5)",
strokeColor: "rgba(151,187,205,0.8)",
highlightFill: "rgba(151,187,205,0.75)",
highlightStroke: "rgba(151,187,205,1)",
data: [data]
and my controller is this
return Json(_reportRepository.GetTransactions(), JsonRequestBehavior.AllowGet);Hi Mario Castro,
In selection Screen initially u have to enter the input value after provides some user command only next screen will be trigger.
In the next screen PBO event you cant assign selection screen Variable into next screen fields.
Eg.
Selection Screen Variable
s_belnr
s_bukrs
s_gjahr
Next Screen
t_belnr
t_bukrs
t_gjahr
In PBO you can code
t_belnr = s_belnr
t_bukrs = s_bukrs
s_gjahr = s_gjahr
Revert back if any difficulties to do.
Regards,
Thangam.P -
Problem displaying CLOB in text file
Hello All,
I have a problem displaying the content from the database in notepad. When I click on a link on my jsf screen, I retrieve the data and display it in notepad.
I have my text content stored in the database with CLOB datatype. When I look in the database the data looks in the following format:
---------STARTS FROM NEXT LINE-------------
The firm, known for its keen oversight of products, has been the subject of complaints from firms who have had apps blocked from the store. Some developers have complained that the company's rules seem inconsistent.
Some have found apps blocked after seemingly minor updates, or for having content deemed inappropriate by them. In light of this, and after careful consideration, I believe it is unnecessary to sign this measure at this time.
Sincerely,
ABC
----------ENDS IN THE PREVIOUS LINE------------
Now when I display this content onto the notepad, all the spaces and new line characters are lost, and the entire display looks awkward. This is how it looks:
The firm, known for its keen oversight of products, has been the subject of complaints from firms who have had apps blocked from the store. Some developers have complained that the company's rules seem inconsistent.[]Some have found apps blocked after seemingly minor updates, or for having content deemed inappropriate by them. In light of this, and after careful consideration, I believe it is unnecessary to sign this measure at this time.[]Sincerely,[]ABC
All the new line characters are lost and it just puts some junk character in place of a new line.
When I copy the same text onto textpad, everything is alright and it displays exactly the way it is present in the database. I am also open to display the content in html, but in HTML it doesn't even display me the junk character in place of new line. It is just one single string without any line separators.
I am using the following code to put the content into the text.
public String writeMessage(){
OutputStream outStream = null;
HttpServletResponse response = getServletResponseFromFacesContext();
Reader data = null;
Writer writer = null;
try{
response.reset();
response.setContentType("text/plain; charset=UTF-8");
response.setHeader("Content-Disposition","attachment; filename="+id+"_Message.txt");
outStream = response.getOutputStream();
QueryRemote remote = serviceLocator.getQueriessEJB();
data = remote.retrieveGovernorsVetoMessage(billId);
writer = new BufferedWriter(new OutputStreamWriter( outStream, "UTF-8" ) );
int charsRead;
char[] cbuf = new char[1024];
while ((charsRead = data.read(cbuf)) != -1) {
System.out.println(charsRead);
writer.write(cbuf, 0, charsRead);
writer.flush();
}catch(Exception ex){
ex.printStackTrace();
}finally{
//Close outStream, data, writer
facesContext.responseComplete();
return null;
}Any help or hints on resolving this issue would be highly appreciated.
Thanks.The data is imported from a third party application to my database. It doesn't display any newline characters when I view the data.
But when I do a regular expression search on text pad, I could see that my clob contains \n as the new line character. Is there a way to replace \n with \n\r while writing the data.
Thanks. -
How to display records into a non table base block..
Hi,
Can anybody help me how to display records into a non table base block....
Find below is my coding but it only display the last record in the first line
in the block.
PROCEDURE CREATE_CARTON_QUESTION IS
CURSOR car_c IS
select /*+ rule */ question_id, question_description
from WHOP.QADB_QUESTIONS
where question_category = 'Carton'
and question_active_flag = 'Y';
v_found VARCHAR2(10);
v_status boolean;
v_error varchar2(150);
v_count number;
car_r car_c%rowtype;
begin
begin
select count(*) into v_count
from WHOP.QADB_QUESTIONS
where question_category = 'Carton'
and question_active_flag = 'Y';
exception
when no_data_found then
v_count := 0;
end;
if v_count > 0 then
for car_r in car_c loop
---populating carton questions
:la_carton.carton_question_id := car_r.question_id;
:la_carton.carton_question_answer := 'N';
:la_carton.carton_error_details := null;
:la_carton.attribute2 := car_r.question_description;
end loop;
end if;
end;
Thanks in advance.
Regards,
JunHi SNatapov,
Thanks for you reply but still I get this error...
FRM-40737 Illegal restricted procedure GO_BLOCK in WHEN-VALIDATE-ITEM trigger.
Please note that I call that program unit in the last field of my control block inside when-validate-item trigger the questions should be display in la_carton block which is my non-base table block.
Find below is the code....
begin
go_block('la_carton');
first_record;
for car_r in car_c loop
---populating carton questions
:la_carton.carton_question_id := car_r.question_id;
:la_carton.carton_question_answer := 'N';
:la_carton.carton_error_details := null;
:la_carton.attribute2 := car_r.question_description;
next_record;
end loop;
end;
Hoping you can help me this problem...
Thanks in advance.
Regards,
Jun -
Problem displaying picture stored in mySQL
Hi, i just have got problem displaying picture stored in database as BLOB and presented on JSP over servlet. Below is my code i am using to upload file into database, than download it and display again. The result is the picture can not draw inself and there is always only empty picture space on the web page i am displaying. Please help me to find why it is not working, thanx.
servlet uploading picture to database
boolean isMultipart = FileUpload.isMultipartContent(req);
DiskFileUpload upload = new DiskFileUpload();
List items = upload.parseRequest(req);
Hashtable textFields = new Hashtable();
byte[] data = new byte[4096];
if(isMultipart)
Iterator iter = items.iterator();
while(iter.hasNext())
FileItem item = (FileItem)iter.next();
if(item.isFormField())
textFields.put(item.getFieldName(), item.getString());
}else{
data = item.get();
String sqlStatement = "INSERT INTO cds VALUES('" textFields.get("id")"'," +
"'" textFields.get("album") "','" textFields.get("interpreter") "'," +
"'" textFields.get("gr1") "','" textFields.get("gr2") "','" textFields.get("price") "')";
String sqlStatement2 = "INSERT INTO pics VALUES('" textFields.get("id") "','" data "')";
servlet to download picture
String SQL =
"SELECT Picture " +
"FROM pics " +
"WHERE id = '" + request.getParameter("id") + "'";
ResultSet rs = stmt.executeQuery(SQL);
rs.next();
Blob blob = null;
blob = rs.getBlob(1);
response.setContentType("image/jpg");
request.setAttribute("blob", blob);
System.out.println("just above OutputStream");
InputStream in = blob.getBinaryStream();
ServletOutputStream sout = response.getOutputStream();
int b;
while ((b = in.read()) != -1) {
sout.write(b);
in.close();
sout.flush();
sout.close();
img tag in JSP
<img src="LoadImageServlet?id=some id>
plus i am using
Tomcat 5.0
mySQL 4.0
debuging in eclipse
thanx for help once more, Libor.1:
are there any exceptions throws by the jdbc code
2:
is the code in a doGet
3:
you should do a if(result.next())
4:
Is your mapping code working -
While I love iWeb's ease of use, it seems to have serious problems displaying on IE. There is really no point blaming IE, since it is the dominant browser and most people who will see our sites will use it. The point of iWeb should be to allow people to communicate broadly and effectively, not just to Mac & Safari users.
Lists do not work well. The indents do not display properly. Text in boxes shift alignment and location. Bullets show up with different sizes. I have had to hand indent and line space all the lists in the sites I make, which is a mess and not scaleable.
See fieldsforkidsmamk.org.
Are there any workarounds or fixes?
The other obvious issues with iWeb are worth noting:
* inconsistent display in browsers -- pages look different in Safari and Firefox, even on the Mac (let alone IE)
* difficulty adding html code
* page names must be identical to nav names, so pages with multiple words (Get Involved) display urls as /Get%20Involved (can't be corrected unless you have Get_Involved as a header.)
* need to publish whole site for any change
* need to publish all sites for each change to any site
* can't change color, display, location, function etc for Nav
I assume everyone is aware of these problems. The question is, what to do? Grin and bear it? Any help, tips or ideas would be appreciated.
Thanks!
MacBook Mac OS X (10.4.8)
MacBook Mac OS X (10.4.8)
MacBook Mac OS X (10.4.8)
MacBook Mac OS X (10.4.8)* page names must be identical to nav names, so pages
with multiple words (Get Involved) display urls as
/Get%20Involved (can't be corrected unless you have
Get_Involved as a header.)
You can fix this the same way you add html code, by post processing.
* need to publish all sites for each change to any
site
You can fix this by separating your sites into different Domain files so you only publish one at a time.
Contrary to the other response, "encoding" is not connected to the points you made. There is never any need to add a UTF-8 "tag" to an iWeb page. If you see question marks or Â's when your page is displayed on any browser, Mac or PC, then you may need to fix your ftp or server settings.
Maybe you are looking for
-
Date formatting in EVDRE reports
Hi, some of the properties in my account dimension are dates (this is an invoice report). In the EVDRE report, these are shown using EVPRO. However, no matter what the formatting is set to in the dimension (number, date), in EVDRE they ONLY show up a
-
Export Reports into Excel?
Can a summary of responses be exported into Excel?
-
Hello all, I am building an application that needs to support multiple configurations for multiple cameras. I currently have a development machine with everything you would expect to be installed, and a deployment machine that does not have LabVIEW i
-
I already purchased imovie from Ipad, can I download the mac version for free?
With the same apple ID I mean Why can't I download it for free from App Store on Mac?
-
Downloaded through gui_download, upload ws_upload displaying junk character
Hello Experts, I have downloaded the data unsing method gui_download, when I tried to upload same file in 4.6 version using function module ws_upload, I am getting junk characters. Is there any soluction to overcome this problem. Please provide your