Why isnt this working urgent please help
why isnt this working im trying to connect a panel to a scrollpane the panel will contain several dozen text fields
the scrollpane shouls be about 350, 450 , but the pane is 350
by 1200 the problem now is that the scorllbar isnt created and even when I explictly create it it contains no knob, and it will
not scroll up or down please someone help this is urgent
import java.awt.*;
import com.sun.java.swing.*;
public class ScrollDemo extends JPanel {
private Rule columnView;
private Rule rowView;
private ScrollablePicture picture;
class UnitsListener implements ItemListener {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
// Turn it to metric.
rowView.setIsMetric(true);
columnView.setIsMetric(true);
} else {
// Turn it to inches.
rowView.setIsMetric(false);
columnView.setIsMetric(false);
picture.setMaxUnitIncrement(rowView.getIncrement());
public ScrollDemo() {
Two t = new Two(columnView.getIncrement());
JScrollPane pictureScrollPane = new JScrollPane(t);
pictureScrollPane.setPreferredSize(new Dimension(300, 250));
pictureScrollPane.setColumnHeaderView(columnView);
pictureScrollPane.setRowHeaderView(rowView);
public static void main(String s[]) {
JFrame frame = new JFrame("ScrollDemo");
frame.setContentPane(new ScrollDemo());
frame.setVisible(true);
import java.awt.*;
import com.sun.java.swing.*;
public class Two extends JPanel implements Scrollable{
private JPanel ivjJPanel3 = null;
private JScrollPane ivjJScrollPane1 = null;
private int maxUnitIncrement = 1;
public Two(int m)
getJPanel1();
maxUnitIncrement = m;
setSize(300,1200);
private void getJPanel1() {
setLayout(null);
setSize(250,1200);
add(getJLabel1(), getJLabel1().getName());
public Dimension getPreferredScrollableViewportSize() {
return getPreferredSize();
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation,
int direction) {
if (orientation == SwingConstants.HORIZONTAL)
return visibleRect.width - maxUnitIncrement;
else
return visibleRect.height - maxUnitIncrement;
public boolean getScrollableTracksViewportHeight() {
return false;
public boolean getScrollableTracksViewportWidth() {
return false;
public int getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction) {
//Get the current position.
int currentPosition = 0;
if (orientation == SwingConstants.HORIZONTAL)
currentPosition = visibleRect.x;
else
currentPosition = visibleRect.y;
//Return the number of pixels between currentPosition
//and the nearest tick mark in the indicated direction.
if (direction < 0) {
int newPosition = currentPosition -
(currentPosition / maxUnitIncrement) *
maxUnitIncrement;
return (newPosition == 0) ? maxUnitIncrement : newPosition;
} else {
return ((currentPosition / maxUnitIncrement) + 1) *
maxUnitIncrement - currentPosition;
public void setMaxUnitIncrement(int pixels) {
maxUnitIncrement = pixels;
I personally didn't play with swing components when they were in the com.sun.java.swing state, but I have a strong feeling it is very buggy and could be causing your problem.
Before posting gui issues, please use a newer API, even jdk1.1 would be fine, anything would be better than what your using.
you wrote: I dont care if its javax.swing or
com.sun.java.swing
I would also gather from this statement that your attitude could be one of your other issues.
Similar Messages
-
This is urgent please help! long running job in sm37 but not in sm66
Hi,
Can someone please help for an explanation as to why if you call sm37, you can see that the job is long running (example about 70,000 sec), but when you look at the PID where the job is running in sm66 it does not show 70,000 sec but only around 6,000 sec.
Can someone please explain why? Thank you very muchFor background processes, additional information is available for the background job that is currently running. You can only display this information, if you are logged onto the instance where the job is running, or if you choose Settings and deselect Display only abbreviated information, avoid RFC. In any case, the job must still be running.
Regards
Anilsai -
VO extension not working-Urgent, please help
Hello Everyone,
I have created a VO extension, but its not showing on the page.
Following are the steps i followed:
1. ftp the folder
2. made project, created extended VO.Since no attribute addition is there, didnt generate VOimpl or VOrowimpl java class files for custom VO.
3. made substituition, imported it to mds repository.(its showing the details of customization using the jdr_utils.printdocument)
4. deployed the .xml files in JAVA_TOP.
5. Cleared cache
6. Bounced Apache and OC4J
Still i cannot see the change done or is the extended VO shown in the business components part in 'about this page'
Please help.
Thanks,
RaivinHello Sravanth,
Its picking the custom VO after i made the changes in substituition.
But i am getting the follwoing error, please check:
Error Page
Exception Details.
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT lkp.lookup_code,
doc.document_type, lkp.meaning, usg.std_user,
usg.non_std_user, usg.has_amendments
FROM (SELECT lookup_type, lookup_code, enabled_flag, start_date_active,
end_date_active, tag, meaning
FROM fnd_lookup_values
WHERE LANGUAGE = USERENV ('LANG')
AND enabled_flag = 'Y'
AND SYSDATE BETWEEN start_date_active
AND NVL (end_date_active, SYSDATE)
AND lookup_type LIKE 'OKC_TERMS_AUTH_ACTIONS%'
AND lookup_type = 'OKC_TERMS_AUTH_ACTIONS_' || :doc_mode
AND (fnd_profile.value('RESP_ID') not in (50744,50745))
UNION ALL
SELECT lookup_type, lookup_code, enabled_flag, start_date_active,
end_date_active, tag, meaning
FROM fnd_lookup_values
WHERE LANGUAGE = USERENV ('LANG')
AND enabled_flag = 'Y'
AND SYSDATE BETWEEN start_date_active
AND NVL (end_date_active, SYSDATE)
AND lookup_type LIKE 'OKC_TERMS_AUTH_ACTIONS%'
AND lookup_type = 'OKC_TERMS_AUTH_ACTIONS_' || :doc_mode
AND lookup_code not in ('LOCK_CONTRACT'
,'REMOVE_TERMS'
,'UPDATE_SOURCE'
,'UPD_VAR_VALUES'
,'UPLOAD')
AND (fnd_profile.value('RESP_ID') in (50744,50745))
) lkp,
(SELECT document_type, doc_preview_function, enable_amend_summary_yn,
enable_attachments_yn, show_preview_btn_yn,
enable_attached_doc_flag, variable_resolution_am
FROM okc_bus_doc_types_b
WHERE document_type = :doc_type) doc,
(SELECT document_type, document_id, template_id,
contract_source_code, lock_terms_flag, enable_reporting_flag,
:is_std_user std_user, :is_non_std_user non_std_user,
okc_terms_util_pvt.has_amendments
(document_id,
document_type,
:doc_version
) has_amendments,
okc_terms_util_pvt.has_uploaded_terms
(document_type,
document_id
) has_uploaded_terms
FROM okc_template_usages
WHERE document_id = :doc_id AND document_type = :doc_type) usg
WHERE doc.document_type = usg.document_type
AND ( ( doc.document_type IN ('OKC_BUY', 'OKC_SELL', 'OKO')
AND lkp.lookup_code = 'CHECK_ART_UPD'
OR ( doc.document_type NOT IN ('OKC_BUY', 'OKC_SELL', 'OKO')
AND DECODE (lkp.lookup_code,
'PREVIEW', DECODE
(DECODE (doc.doc_preview_function,
NULL, 'N',
'Y'
'Y', NVL (doc.show_preview_btn_yn,
'Y'
'N'
'REMOVE_TERMS', DECODE (usg.std_user,
'Y', usg.non_std_user,
'N'
'UPDATE_SOURCE', DECODE (usg.contract_source_code,
'ATTACHED', DECODE
(usg.std_user,
'Y', usg.non_std_user,
'N'
'Y'
'VIEW_AMEND', DECODE
(lkp.lookup_type,
'OKC_TERMS_AUTH_ACTIONS_AMEND', NVL
(doc.enable_amend_summary_yn,
'N'
'OKC_TERMS_AUTH_ACTIONS_VIEW', DECODE
(usg.has_amendments,
'Y', NVL
(doc.enable_amend_summary_yn,
'N'
'N'
'MANAGE_K_DOCS', NVL (doc.enable_attachments_yn,
'N'),
'DOWNLOAD', DECODE
(NVL (doc.enable_attached_doc_flag,
'Y'
'Y', DECODE
(usg.contract_source_code,
'STRUCTURED', 'Y',
'N'
'Y', 'Y',
'N', 'N'
'RESUME_CTRT_UPLOAD', DECODE
(usg.std_user,
'Y', DECODE
(usg.non_std_user,
'Y', DECODE
(has_uploaded_terms,
'Y', 'Y',
'N'
'N'
'N'
'UPLOAD', DECODE
(usg.std_user,
'Y', DECODE
(usg.non_std_user,
'Y', DECODE
(has_uploaded_terms,
'Y', 'N',
'Y'
'N'
'N'
'LOCK_CONTRACT', DECODE (usg.lock_terms_flag,
'Y', 'N',
'Y'
'UNLOCK_CONTRACT', DECODE
(has_uploaded_terms,
'Y', 'N',
DECODE (usg.lock_terms_flag,
'Y', 'Y',
'N'
'REVIEW_DEV_REP', DECODE
(doc.variable_resolution_am,
NULL, 'N',
'Y'
'Y'
) = 'Y'
AND ( ( lkp.lookup_type = 'OKC_TERMS_AUTH_ACTIONS_AMEND'
AND ( ( lkp.lookup_code = 'UPDATE_SOURCE'
AND DECODE (usg.std_user, 'Y', usg.non_std_user, 'N') =
'Y'
OR (lkp.lookup_code <> 'UPDATE_SOURCE')
OR (lkp.lookup_type <> 'OKC_TERMS_AUTH_ACTIONS_AMEND')
AND ( (usg.contract_source_code = 'STRUCTURED')
OR (( usg.contract_source_code = 'ATTACHED'
AND lkp.lookup_code NOT IN
('CHECK_ART_UPD',
'REVIEW_DEV_REP',
'UPD_VAR_VALUES',
'DOWNLOAD'
OR ( usg.contract_source_code = 'ATTACHED'
AND usg.enable_reporting_flag = 'Y'
AND ( ( doc.variable_resolution_am IS NULL
AND lkp.lookup_code NOT IN
('DOWNLOAD',
'REVIEW_DEV_REP',
'RESUME_CTRT_UPLOAD',
'UNLOCK_CONTRACT',
'LOCK_CONTRACT',
'UPLOAD'
OR (doc.variable_resolution_am IS NOT NULL)
AND ( ( NVL (usg.lock_terms_flag, 'N') = 'Y'
AND lkp.lookup_code NOT IN
('CHECK_ART_UPD',
'LOCK_CONTRACT',
'REMOVE_TERMS',
'UPDATE_SOURCE'
OR (NVL (usg.lock_terms_flag, 'N') = 'N')
ORDER BY lkp.tag
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:896)
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:870)
at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:993)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:211)
at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:153)
at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:762)
at oracle.apps.okc.terms.webui.StructureContainedCO.getActionsForDocument(StructureContainedCO.java:2306)
at oracle.apps.okc.terms.webui.StructureContainedCO.processRequest(StructureContainedCO.java:301)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:596)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:251)
at oracle.apps.fnd.framework.webui.beans.layout.OATableLayoutBean.processRequest(OATableLayoutBean.java:353)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:964)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:931)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:655)
at oracle.apps.fnd.framework.webui.OAFlexibleContentHelper.processRequest(OAFlexibleContentHelper.java:504)
at oracle.apps.fnd.framework.webui.beans.OAFlexibleContentBean.processRequest(OAFlexibleContentBean.java:356)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:964)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:931)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:655)
at oracle.apps.fnd.framework.webui.beans.layout.OAFlexibleLayoutBean.processRequest(OAFlexibleLayoutBean.java:357)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:964)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:931)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:655)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:251)
at oracle.apps.fnd.framework.webui.beans.layout.OAStackLayoutBean.processRequest(OAStackLayoutBean.java:350)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:964)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:931)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:655)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:251)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1166)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:964)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:931)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:655)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:251)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:964)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:931)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:655)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:251)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2513)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1894)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:538)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:426)
at OA.jspService(_OA.java:212)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:259)
at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)
at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:284)
at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)
at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:395)
at OA.jspService(_OA.java:221)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:619)
## Detail 0 ##
java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: 1
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:11110)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObjectAtName(OraclePreparedStatementWrapper.java:815)
at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:3919)
at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3335)
at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:13827)
at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:804) -
DEAL OR NO DEAL HELP THIS IS URGENT PLEASE HELP ME!!!!!
i have a project due in two days and i must create a deal or no deal game in java the following is the code i have currently created i am not very advanced so this is where i am at so far:
// The "DealorNoDeal" class.
import java.awt.*;
import hsa.Console;
import java.util.Random;
public class DealorNoDeal
static Console c;
public static void main (String[] args)
c = new Console (30, 110, 15, "DEAL OR NO DEAL");
//setSize(500,500);
double[] CasesValues = {.01, 1, 5, 10, 25, 50, 75, 100, 200, 300, 400, 500, 750, 1000, 5000, 10000, 25000, 50000, 75000, 100000, 200000, 300000, 400000, 500000, 750000, 1000000};
double[] Case = new double [26];
int number = 0, Choosen, Remove = 0, Offer = 0;
double PlayerCase;
Random generator = new Random ();
boolean Picked = false;
char Deal = ' ';
boolean Not = false;
String name;
// USER ENTERS THEIR NAME
c.println ("Please enter your name: ");
name = c.readString ();
c.println (" ");
// THIS PUTS THE NUMBERS IN THEIR CASES
for (int i = 1 ; i < 26 ; i++)
number = generator.nextInt (26);
Case = CasesValues [number];
for (int i = 0 ; i < 13 ; i++)
c.println (CasesValues [i] + "\t\t" + CasesValues [i + 13]);
// THE USER CHOOSES THEIR CASE
c.println ("Please Pick Your Case");
Choosen = c.readInt ();
PlayerCase = Case [Choosen];
c.clear ();
// THE USER PICKS 6 CASES TO REMOVE
for (int x = 1 ; x < 7 ; x++)
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
if (Remove == i)
c.clear ();
c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
Case [i] = 0;
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
if (Case [i] == 0)
c.print (" " + i);
c.println ();
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
Offer += Case [i];
Offer = Offer / 19;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal == 'Y' || Deal == 'y')
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
else if (Deal == 'N' || Deal == 'n')
c.println ("ALRIGHT NOW YOU MUST OPEN 5 CASES");
// THE USER PICKS 5 CASES TO REMOVE
for (int x = 1 ; x < 6 ; x++)
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
if (Remove == i)
c.clear ();
c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
Case [i] = 0;
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
if (Case [i] == 0)
c.print (" " + i);
c.println ();
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
Offer += Case [i];
Offer = Offer / 14;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal == 'Y' || Deal == 'y')
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
else if (Deal == 'N' || Deal == 'n')
c.println ("ALRIGHT WE WILL CONTINUE TO OPEN CASES");
// THE USER PICKS 4 CASES TO REMOVE
for (int x = 1 ; x < 5 ; x++)
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
if (Remove == i)
c.clear ();
c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
Case [i] = 0;
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
if (Case [i] == 0)
c.print (" " + i);
c.println ();
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
Offer += Case [i];
Offer = Offer / 10;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal == 'Y' || Deal == 'y')
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
else if (Deal == 'N' || Deal == 'n')
c.println ("ALRIGHT WE WILL CONTINUE BY OPENING 3 CASES");
// THE USER PICKS 3 CASES TO REMOVE
for (int x = 1 ; x < 4 ; x++)
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
if (Remove == i)
c.clear ();
c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
Case [i] = 0;
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
if (Case [i] == 0)
c.print (" " + i);
c.println ();
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
Offer += Case [i];
Offer = Offer / 7;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal == 'Y' || Deal == 'y')
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
else if (Deal == 'N' || Deal == 'n')
c.println ("ALRIGHT," + name + "YOU MUST CHOOSE 2 CASES TO OPEN NOW");
// THE USER PICKS 2 CASES TO REMOVE
for (int x = 1 ; x < 3 ; x++)
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
if (Remove == i)
c.clear ();
c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
Case [i] = 0;
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
if (Case [i] == 0)
c.print (" " + i);
c.println ();
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
Offer += Case [i];
Offer = Offer / 5;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal == 'Y' || Deal == 'y')
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
else if (Deal == 'N' || Deal == 'n')
c.println ("ALRIGHT," + name + "YOU MUST CHOOSE 1 CASE TO OPEN NOW");
// THE USER PICKS 1 CASES TO REMOVE
for (int x = 1 ; x < 2 ; x++)
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
if (Remove == i)
c.clear ();
c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
Case [i] = 0;
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
if (Case [i] == 0)
c.print (" " + i);
c.println ();
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
Offer += Case [i];
Offer = Offer / 4;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal == 'Y' || Deal == 'y')
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
else if (Deal == 'N' || Deal == 'n')
c.println ("ALRIGHT," + name + "YOU MUST CHOOSE 1 CASE TO OPEN NOW");
// THE USER PICKS 1 CASES TO REMOVE
for (int x = 1 ; x < 2 ; x++)
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
if (Remove == i)
c.clear ();
c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
Case [i] = 0;
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
if (Case [i] == 0)
c.print (" " + i);
c.println ();
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
Offer += Case [i];
Offer = Offer / 3;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal == 'Y' || Deal == 'y')
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
else if (Deal == 'N' || Deal == 'n')
c.println ("ALRIGHT," + name + "YOU MUST CHOOSE 1 CASE TO OPEN NOW");
// THE USER PICKS 1 CASES TO REMOVE
for (int x = 1 ; x < 2 ; x++)
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
if (Remove == i)
c.clear ();
c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
Case [i] = 0;
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
if (Case [i] == 0)
c.print (" " + i);
c.println ();
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
Offer += Case [i];
Offer = Offer / 2;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal == 'Y' || Deal == 'y')
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
else if (Deal == 'N' || Deal == 'n')
c.println ("NOW ITS TIME TO OPEN ONE MORE CASE");
// THE USER PICKS 1 CASES TO REMOVE
for (int x = 1 ; x < 2 ; x++)
c.print ("Please Choose Case To Remove: ");
Remove = c.readInt ();
for (int i = 1 ; i < 26 ; i++)
if (Remove == i)
c.clear ();
c.println ("You Picked Case " + Remove + " That had a value of " + Case [i]);
Case [i] = 0;
c.println ();
c.print ("Case Numbers Picked: ");
for (int i = 1 ; i < 26 ; i++)
if (Case [i] == 0)
c.print (" " + i);
c.println ();
// CALCULATES AND MAKES OFFER
for (int i = 1 ; i < 26 ; i++)
Offer += Case [i];
Offer = Offer / 2;
c.clear ();
c.println ("The Offer is: " + Offer);
c.println ("DO YOU ACCPET (Y/N)");
Deal = c.readChar ();
if (Deal == 'Y' || Deal == 'y')
c.clear ();
c.println ("CONGRATS, YOU LEAVE WITH " + Offer + "DOLLARS");
else if (Deal == 'N' || Deal == 'n')
c.println ("NOW ITS TIME TO OPEN YOUR CASE, YOUR CASE CONTAINED " + (Offer * 2) + " DOLLARS");
i would really appreciate it if you could show me how to tell the player when they have already chose a case and not let them choose it again and if possible have all the values display and eliminate the values as they the cases are opened my e-mail is [email protected] if you can e-mail there or add me on msn it would be really appreciated also for future reference thanksWhy is everybody on this thread so violent.Nobody was violent.
Just to address my first posts.
1) The subject line is very annoying
2) Asking for people to email you is not on
3) The code is crap. It's unbearable lengthy and the more I looked at it the more I cringed. As you yourself noted in your reply more methods would be a good start. Even if hero were to get the program in it's current form to work then as a grade it gets no better than a D and possibly an F anyway.
So while I think encouragement is fine and noble there are sometimes you have to call a spade a spade. The OP (_hero_) if he wants help here needs to be prepared to interact on the forum in a communally acceptable fashion (see 1 and 2) and to start from scratch with his code (see 3). While this may not be what the OP wanted to hear playing pollyanna about it is counter-productive.
All I did was give my advice to the guy and now IM
getting torn to pieces by prometheuzzzzzzz and
marcrules.
Look:
1) I taught myself Java and I didn't learn the
conventions properly (at all).
2) I can't indent code directly in the java forum
message editor.
3) When I write my posts I often dont test them
because they're pseudo-code so they dont need to be
made in Eclipse or JCreator or w/e.There is a lot of whining going on here. Just take the advice given for what it is worth. Learn conventions. Start indenting. Stop using an IDE (for now).
Above all stop taking it so personally. If you post code that is crap on this site more often then not someone will point it out. Subtly or un-subtly as the case may be.
4) Stop being so violent towards people when they're
asking for helpAgain see my previous points. Nobody was violent to anyone. Further the OP needs a wakeup call.
>
Does that explain why i code as i do?Not really. -
I checked its been uninstalled from my mac and then every time I reinstall it, it just perpetually sits on that page that says 'inDesign is downloading now'... but it never does. Need urgent help please! Photoshop and illustrator remained on my mac no issue there. Whats going on?...
Musecatherine please begin the installation process in the Creative Cloud Desktop application. You can find details on how to install the Adobe Creative applications, included with your membership, at Install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html.
It is likely that the AAM Detect Plug-in is not installed or blocked by your current web browser. This is why no action occurs when you are on the download page. -
Iphone data roaming - option not working ( urgent please help)
I am going on a long holiday (3months) to various countries from Canada and I will be using my phone only for the first leg of the journey for 15 days just to keep in touch with my family to say I'm safe and all. I dont want to unlock or jailbreak my phone.
Is there a way to disable the 3G to avoid roaming charges ( Since I am on a contract I cant ask my provider to block it) I turn on the data roaming option but the 3G sign is still shown and its still connecting to the network
Is there any other way"I turn on the data roaming option but the 3G sign is still shown and its still connecting to the network"
Are you out of the country when you do this? It won't disable data when you are in your home network.
From the manual:
"Data Roaming turns on Internet and visual voicemail access over a cellular data
network when you’re in an area not covered by your carrier’s network. For example,
when you’re traveling, you can turn off Data Roaming to avoid potential roaming
charges. By default, Data Roaming is turned off. "
BTW, I'm not sure how helping you avoid a roaming bill is urgent. Some have much more "urgent" problems, like crashes, unresponsive iphones, etc. -
After a big loss of out-pulled hair here is the code:
setInterval() calls getNewMess function but it happens
nothing with onNewMess function.
Instead, if i click refresh-button, it gives me result
correctly.evt.target._parent
is just using the event argument that is dispatched to and
therefore received by your listener function. It is dispatched/sent
by your button component instance. The event object from components
- in as2 - normally contains at least two properties. A type
property... in this case that's "click" , because its a click event
and a target property. The target property is a reference to the
component instance from which the event originated. It can be
particularly useful if you have one listener handling events from
many sources. So.....
evt.target._parent is referring to the container clip of the
instance that sent the event. i.e. The _parent of the button in
this case.
That's why I replaced it with t (=this) which is a reference
to the timeline that the button is running in. Now it doesn't need
to get that reference from checking the _parent of the evt.target
property from the evt argument. Which means the argument that the
newMess function receives can be ignored and its no longer reliant
on it. Sounds confusing but once you "get" it, it all makes sense.
Eventually, lol.
And of couse you don't need to have a button if you don't
want one. -
Why isnt this working?? - I really need this!!!
Hi, can you please have a go at this problem? Thnx!!
Here is the code:
import java.io.*;
public class Main {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
private String newname=null;
public void setName ()throws Exception{
System.out.print("Hello, please enter your attribute");
newname = in.readLine();}
public String getName(){
return newname;}
public Main()throws Exception{
Main m = new Main();
m.setName();
import java.io.*;
public class Main2 {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
private String newname=null;
public void setName ()throws Exception{
System.out.print("Please enter your sign");
newname = in.readLine();}
public String getName()throws Exception{
Main z = new Main();
z.setName();
if(newname.equals("=")){
return ("==" + z.getName());}
else{
return "Error";}}
public Main2()throws Exception{
Main2 p = new Main2();
p.setName();}}
import java.io.*;
public class Main3 {
public static void main(String[] args)throws Exception {
Main2 p = new Main2();
System.out.print("Hello "+p.getName());}}For one, Main2 has a recursive constructor:
public Main2() throws Exception
//Main2 p=new Main2();
//p.setName();
setName(); // You don't need another instance
}Also, there is no reason to create a new class to get every entry from standard in. You could just do:
System.out.println("Enter A: ");
a=in.readLine();
System.out.println("Enter B: ");
b=in.readLine(); -
Tv tuner problem!!!! this is urgent please help....
Hi,
I'm trying to capture vidfeo from tv tuner I've done it before with several kinds of tuners
I'm using " Ati All In Wonder 128 " -display adapter with tv tuner- now and it is giving strange colors on JMF
studio although it runs fine on Ati software
any help will be good even any wild guesses will be helpful
dukethanks for your reply
this problem is fixed now after I captured another format UYVY instead of YUV
but there is a nother problem if capture with 16 pits per pixel the screen is fine but with 24 a thick black line is at the top of the screen
the problem is I can change the pits per pixel parameter in jmf studio
but in my code
I query the CaptureDeviceManager with a VideoFormat object (it has no way to set the pits per pixel)
and it is giving the black line
and when I try to query the CaptureDeviceManager with RGBFormat object to set teh pits per pixel
It returns a 0 length array of capture device info
are you familiar with such a problem
thanks in advance -
Circular Doubly-linked list: Cannot seem to get this working. Please help!
Hello, I am trying to implement a CDLL of Node objects that look like: (null/char/char/null);
here are my Node and List (called cipher) constructors & insert() method:
Node constructors:
// Default constructor
// -Takes no args
// -Assigns plaintext val to ''
// -Assigns cipher val to ''
// -Assigns left & right pointers to null
public Node() {
previous = null;
plaintext = ' ';
ciphertext = ' ';
next = null;
}//end default constructor
// Constructor 2
// -Assigns left & right pointers to null
// -Parameter: char newPlaintext: the plaintext value to be assigned to the Node
// -Parameter: char newCipher: the cipher value to be assigned to the Node
public Node(char newPlaintext, char newCipher) {
previous = null;
plaintext = newPlaintext;
ciphertext = newCipher;
next = null;
}//end constructor 2List Constructor:
public Cipher() {
//Create the Node coder with empty elements that points to itself
sentinel = new Node(' ', ' ');
//coder points to itself in both directions
sentinel.setNext(sentinel.previous);
sentinel.setPrevious(sentinel.next);
//Set pointer to the node created
current = sentinel;
}//end Cipher() defalut constructorinsert() method:
public static void insert(char thePlaintext, char theCiphertext) {
Node temp = new Node(thePlaintext, theCiphertext);
if (isEmpty()) {
System.out.println(" in the isEmpty area of insert");
current = temp;
sentinel = temp;
}else {
System.out.println(" in the not empty area of insert");
Node p = current.getNext();
current.setNext(temp);
temp.setPrevious(current);
temp.setNext(p);
p.setPrevious(temp);
p = current.getNext();
current = temp; //Set last pointer to point to x
System.out.println("Current.plaintext is: "+current.plaintext);
System.out.println("p.plaintext is: "+p.plaintext);
current = temp; //Set last pointer to point to x
}//end ifI'm thinking that the problem is something relatively simple... I just can't seem to get it right.
Can somebody please tell me what's wrong w/ this data structure?
Thanks in advance to everyone.Hello there, BrenFire.
The following Knowledge Base article provides assistance with downloading your purchased content:
Downloading past purchases from the iTunes Store, App Store, and iBooks Store
http://support.apple.com/kb/HT2519
Particularly:
TV Shows
Make sure you're signed in with the same Apple ID you used for the original purchase.
Tap the Videos app.
Tap TV Shows, at the bottom of the page.
Find and tap the show and season you want to download.
Tap the download icon next to the episode you want to download.
The TV show will begin downloading.
Thanks for reaching out to Apple Support Communities.
Cheers,
Pedro. -
How to write this application - URGENT PLEASE HELP
I would like to write a program for a supermarket loyalty card system. The program should have 2 customers and 2 gifts on offer. The customer details and the gift details can be hard coded.
When the program starts the user should be shown a menu which will have options to
view all customer details
add points for a customer
buy a gift
When the user chooses to buy a gift ro to add points, any changes made to the customers' points must be done using methods. Adding or buying gifts should be done using customer id's and gift id's.
The user must be able to see the altered points.
I WILL APPRECIATE IF I COULD GET HELP EVEN FOR PSEUDOCODE.Not as much as this guy tho http://forum.java.sun.com/thread.jsp?forum=31&thread=486327&tstart=150&trange=15
-
HT204380 Why isnt this working
I have an Ipad2, every single time i facetime with someone using a iphone 4s, i can hear what they are saying but they can't hear what i am saying.how do i fix this?...i enjoy having to write down what i think on paper, but i would rather talk =)
Using FaceTime http://support.apple.com/kb/ht4319
Troubleshooting FaceTime http://support.apple.com/kb/TS3367
The Complete Guide to FaceTime: Set-up, Use, and Troubleshooting Problems
http://tinyurl.com/32drz3d
I saw one post where a user said dust got inside the small microphone hole. Using a vacuum cleaner removed the dust and restored the audio.
Cheers, Tom -
Why isnt this working? add container to frame..
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MortgageCalcFrame {
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("Mortgage calculator");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Add's a container in the frame
Container content = new Container();
frame.getContentPane().add(content, BorderLayout.SOUTH);
JButton btn = new JButton("test");
content.add(btn, BorderLayout.EAST);
JTextField input = new JTextField(5);
frame.getContentPane().add(input, BorderLayout.CENTER);
//Display the window.
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}Well the problem you got is that the layout of a Container is null. You've got several options here.
1. You set a layout for your container like this
Container content = new Container();
content.setLayout(new FlowLayout());2. You use a different container that inherits from container like Panel or JPanel since this one already got a FlowLayout set.
Panel content = new Panel();or
JPanel content = new JPanel(); //better since you're currently mixing Swing components and AWT. -
in i photo double clcking on a photo it comes full screen briefly and then goes off and a
exclamation mark appearsiPhoto rebuild database: https://support.apple.com/kb/HT2638
Sometimes it's a file problem that is automatically loaded when the program launches, like iPhoto for instance, you'll have to do a tedious process of elimination to find the culprit, like a corrupt picture in a huge iPhoto Library folder.
One can right click on the iPhoto Library and "show package contents" to access the Originals folder containing one's original photos.
..Step by Step to fix your Mac -
Urgent please help, this program should work
Urgent please help.
I need to solve or I will be in big trouble.
This program works at my home computer which is not networked.
The hard disk was put onto another computer at another location whihc is networked. Here my program worked on Monday 14 october but since for the last two days it is not working without me changing any code. Why do I receive this error message???
Error: 500
Location: /myJSPs/jsp/portal-project2/processviewfiles_dir.jsp
Internal Servlet Error:
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:460)
at jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:162)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)
Root cause:
java.lang.NullPointerException
at jsp.portal_0002dproject2.processviewfiles_dir_1._jspService(processviewfiles_dir_1.java:132)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:574)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java:235)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:917)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)foolishmatt,
The code is quit large.
to understand the program I think all the code needs to be examined.
I would need to send to you in an email.
Here is my e-mail
[email protected]
if you contact me than I can send the code to you.
Thank you in advance.
Maybe you are looking for
-
Adobe creative cloud and CS6 Illustrator download was a disaster
After downloading Adobe creative cloud and CS6 Illustrator my system wwent into crash mode with one error after another. Had no less than 4 blue screens of death (BSOD) and I had to do restore but lost most of my files and cannnot get them back. What
-
Adding music files to iDVD project
Hello All, Sorry if this has been asked before... I didn't seem to find anything in my "search" of past posts... A friend of mine recently passed away & I am (trying to) putting together a dvd to send to his brother that includes some home video of u
-
I first realized this problem existed after trying to play music on my iPod Touch 3rd gen. The music did not sound clear and the lyrics are not distinguishable at all. I thought maybe my iPod was damaged or something had gotten into the speakers, so
-
Issue in adobe forms scripting.
Hi Guys, I'm trying to create here an Interactive form embedded into a Wed Dynpro Java application. On the Interactive form i simply have a Text Field and two buttons. On the click of one button, the Text Field should get Invisible, and on the click
-
Hi. Which Directive/Class will be the better choice if your app is mainly a video camera app. I saw about 3 different Classes to capture videos. I'm currently using Microsoft.Devices/CaptureDevice to capture video. It looks limited to me because foun