Help with a simple book preset
Hi I am trying to save a simple preset with a caption field and a file name field under the image.
With a single image per page and same page left and right.
When i run Auto Layout either it shows the caption or it shows the file name and then i have to manually select all text cells and apply a preset text field with name and caption.
No matter how many times i try and recreate a basic preset it just does not work
ANy one can supply or tell me what i need to do so when i click auto layout i get a medium size image with file name and caption under it without having to do any more layout
Thanks
Hi I am trying to save a simple preset with a caption field and a file name field under the image.
With a single image per page and same page left and right.
When i run Auto Layout either it shows the caption or it shows the file name and then i have to manually select all text cells and apply a preset text field with name and caption.
No matter how many times i try and recreate a basic preset it just does not work
ANy one can supply or tell me what i need to do so when i click auto layout i get a medium size image with file name and caption under it without having to do any more layout
Thanks
Similar Messages
-
Need help with a simple process with FTP Adapter and File Adapter
I am trying out a simple BPEL process that gets a file in opaque mode from a FTP server using a FTP adapter and writes it to the local file system using a File Adapter. However, the file written is always empty (zero bytes). I then tried out the FTPDebatching sample using the same FTP server JNDI name and this work fine surprisingly. I also verified by looking at the FTP server logs that my process actually does hit the FTP server and seems to list the files based on the filtering condition - but it does not issue any GET or RETR commands to actually get the files. I am suspecting that the problem could be in the Receive, Assign or Invoke activities, but I am not able identify what it is.
I can provide additional info such as the contents of my bpel and wsdl files if needed.
Would appreciate if someone can help me with this at the earliest.
Thanks
Jaypersiandude wrote:
Topic: Need help with if, else, and which statements and loops.
How would I display 60 < temp. <= 85 in java
System.out.println("60 < temp. <= 85 in java");
another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
[http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806]. -
Need help with a simple program (should be simple anyway)
I'm (starting to begin) writing a nice simple program that should be easy however I'm stuck on how to make the "New" button in the file menu clear all the fields. Any help? I'll attach the code below.
====================================================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Message extends JFrame implements ActionListener {
public void actionPerformed(ActionEvent evt) {
text1.setText(" ");
text2.setText("RE: ");
text3.setText(" ");
public Message() {
super("Write a Message - by Kieran Hannigan");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(370,270);
FlowLayout flo = new FlowLayout(FlowLayout.RIGHT);
setLayout(flo);
//Make the bar
JMenuBar bar = new JMenuBar();
//Make "File" on Menu
JMenu File = new JMenu("File");
JMenuItem f1 = new JMenuItem("New");f1.addActionListener(this);
JMenuItem f2 = new JMenuItem("Open");
JMenuItem f3 = new JMenuItem("Save");
JMenuItem f4 = new JMenuItem("Save As");
JMenuItem f5 = new JMenuItem("Exit");
File.add(f1);
File.add(f2);
File.add(f3);
File.add(f4);
File.add(f5);
bar.add(File);
//Make "Edit" on menu
JMenu Edit = new JMenu("Edit");
JMenuItem e1 = new JMenuItem("Cut");
JMenuItem e2 = new JMenuItem("Paste");
JMenuItem e3 = new JMenuItem("Copy");
JMenuItem e4 = new JMenuItem("Repeat");
JMenuItem e5 = new JMenuItem("Undo");
Edit.add(e5);
Edit.add(e4);
Edit.add(e1);
Edit.add(e3);
Edit.add(e2);
bar.add(Edit);
//Make "View" on menu
JMenu View = new JMenu("View");
JMenuItem v1 = new JMenuItem("Bold");
JMenuItem v2 = new JMenuItem("Italic");
JMenuItem v3 = new JMenuItem("Normal");
JMenuItem v4 = new JMenuItem("Bold-Italic");
View.add(v1);
View.add(v2);
View.add(v3);
View.addSeparator();
View.add(v4);
bar.add(View);
//Make "Help" on menu
JMenu Help = new JMenu("Help");
JMenuItem h1 = new JMenuItem("Help Online");
JMenuItem h2 = new JMenuItem("E-mail Programmer");
Help.add(h1);
Help.add(h2);
bar.add(Help);
setJMenuBar(bar);
//Make Contents of window.
//Make "Subject" text field
JPanel row2 = new JPanel();
JLabel sublabel = new JLabel("Subject:");
row2.add(sublabel);
JTextField text2 = new JTextField("RE:",24);
row2.add(text2);
//Make "To" text field
JPanel row1 = new JPanel();
JLabel tolabel = new JLabel("To:");
row1.add(tolabel);
JTextField text1 = new JTextField(24);
row1.add(text1);
//Make "Message" text area
JPanel row3 = new JPanel();
JLabel Meslabel = new JLabel("Message:");
row3.add(Meslabel);
JTextArea text3 = new JTextArea(6,22);
messagearea.setLineWrap(true);
messagearea.setWrapStyleWord(true);
JScrollPane scroll = new JScrollPane(text3,
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
//SpaceLine
JPanel spaceline = new JPanel();
JLabel spacer = new JLabel(" ");
spaceline.add(spacer);
row3.add(scroll);
add(row1);
add(row2);
add(spaceline);
add(spaceline);
add(row3);
setVisible(true);
public static void main(String[] arguments) {
Message Message = new Message();
}persiandude wrote:
Topic: Need help with if, else, and which statements and loops.
How would I display 60 < temp. <= 85 in java
System.out.println("60 < temp. <= 85 in java");
another question is how do I ask a question like want to try again (y/n) after a output and asking that everytime I type in yes after a output and terminate when saying No.Sun's [basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
Sun's [New To Java Center|http://java.sun.com/learning/new2java/index.html].Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
[http://javaalmanac.com|http://javaalmanac.com]. A couple dozen code examples that supplement [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance].
jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
Bruce Eckel's [Thinking in Java|http://mindview.net/Books/DownloadSites] (Available online.)
Joshua Bloch's [Effective Java|http://www.amazon.com/Effective-Java-2nd-Joshua-Bloch/dp/0321356683/ref=pd_bbs_1?ie=UTF8&s=books&qid=1214349768&sr=8-1]
Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance].
James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806]. -
Need help with pagination for book
I am working on a book and need help with the pagination. I was able to make the TOC and front matter show the numbers as Roman numerals, and the body of the text as Arabic numerals, but I can't figure out how to restart the numbering sequence for the body of the text. So the front matter is numbered i-xvi, and the text is 17-681. I need the text to start with the number 1. Each subsequent chapter is a section break as well, if that makes a difference.
Many thanks,
JClick on the page that shall start on number one. Open Inspector palette > Layout inspector (2nd tab) >
Section > Start at: > 1 -
Need help with a simple basketball game.
Hi im new here and I need help with making this simple basketball game.
Im trying to recreate this game from this video. Im not sure if he is using as2 or as3
Or if anyone could help me make a game like this or direct me to a link on how to do it It would be greatly appreciated.If you couldn't tell whether it is AS2 or AS3, it is doubtful you can turn it from AS2 into AS3, at least not until you learn both languages. There is no tool made that does it for you.
-
Help with a simple program.
I need some help writing a simple program. Can anybody help??
thanks to all.
2. HTML Java Source Code Reserved Word Highlighter
Write a program that inputs a Java source code file and outputs a copy of that file with Java keywords surrounded with HTML tags for bold type. For example this input:
public class JavaSource
public static void main ( String[] args )
if ( args.length == 3 )
new BigObject();
else
System.out.println("Too few arguments.");
will be transformed into:
<B>public</B> <B>class</B> JavaSource
<B>public</B> <B>static</B> <B>void</B> main ( String[] args )
<B>if</B> ( args.length == 3 )
<B>new</B> BigObject();
<B>else</B>
System.out.println("Too few arguments.");
In a browser the code will look like this:
public class JavaSource
public static void main ( String[] args )
if ( args.length == 3 )
new BigObject();
else
System.out.println("Too few arguments.");Here is something that may get you started...
import java.io.*;
import java.util.*;
public class HtmlJava{
public static void main(String arg[]){
if(arg.length!=1){
System.out.println("Usage java HtmlJava sourceFile");
else
new HtmlJava(arg[0]);
HtmlJava(String source){
try{
BufferedReader sourceReader=new BufferedReader(new InputStreamReader(new FileInputStream(source)));
BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(source+"Html.txt")));
Vector keywords=new Vector();
addKeywords(keywords);
String line;
StringTokenizer tokenizer=null;
String word;
while((line=sourceReader.readLine () )!=null){
tokenizer=new StringTokenizer(line);
while(tokenizer.hasMoreTokens()){
word=tokenizer.nextToken();
if(keywords.contains(word)){
writer.write(""+word+" ");
else{
writer.write(word+" ");
writer.write("\r\n");
writer.close();
sourceReader.close();
System.out.println("Output File written to "+source+"Html.txt");
catch(Exception ex){
ex.printStackTrace();
private void addKeywords(Vector keywords){
keywords.addElement ( "abstract");
keywords.addElement( "boolean");
keywords.addElement( "break");
keywords.addElement( "byte");
keywords.addElement( "byvalue");
keywords.addElement( "case");
keywords.addElement( "cast");
keywords.addElement( "catch");
keywords.addElement( "char");
keywords.addElement( "class");
keywords.addElement( "const");
keywords.addElement( "continue");
keywords.addElement( "default");
keywords.addElement( "do");
keywords.addElement( "double");
keywords.addElement( "else");
keywords.addElement( "extends");
keywords.addElement( "false");
keywords.addElement( "final");
keywords.addElement( "finally");
keywords.addElement( "float");
keywords.addElement( "for");
keywords.addElement( "future");
keywords.addElement( "generic");
keywords.addElement( "goto");
keywords.addElement( "if");
keywords.addElement( "implements");
keywords.addElement( "import");
keywords.addElement( "inner");
keywords.addElement( "instanceof");
keywords.addElement( "int");
keywords.addElement( "interface");
keywords.addElement( "long");
keywords.addElement( "native");
keywords.addElement( "new");
keywords.addElement( "null");
keywords.addElement( "operator");
keywords.addElement( "outer");
keywords.addElement( "package");
keywords.addElement( "private");
keywords.addElement( "protected");
keywords.addElement( "public");
keywords.addElement( "rest");
keywords.addElement( "return");
keywords.addElement( "short");
keywords.addElement( "static");
keywords.addElement( "super");
keywords.addElement( "switch");
keywords.addElement( "synchronized");
keywords.addElement( "this");
keywords.addElement( "throw");
keywords.addElement( "throws");
keywords.addElement( "transient");
keywords.addElement( "true");
keywords.addElement( "try");
keywords.addElement( "var");
keywords.addElement( "void");
keywords.addElement( "volatile");
keywords.addElement( "while");
}Hope it helped -
Help with a simple 1811 configuration
I have a very basic level of understanding with Cisco products and I need help with what should be simple and even doable by me.
I have a Cisco 1811 integrated router and am simply trying to use it on my home network. I can configure the router with an enable secret password, password encryption, VTY, aux, and cons logins with no issues. The router has 2 Ethernet interfaces, 0 and 1 and 8 switch ports.
The idea is to bring Comcast ISP service into one of the Ethernet ports and then have three machines on the switch ports able to access the Internet. Also I have an off-the shelf wireless router that I thought I would just plug that into an available switch port and allow a wireless AP as well.
This is so simply, that I can't believe I can't figure it out, but I can't.
I set int F1 to DHCP, performed a 'no shut', and connected the ISP's router and have an up and up indication. I have setup a static network with my three machines on the switch ports and enabled all applicable ports and have up and up indications - however, no traffic flow, even amongst my static Layer 2 switched LAN - not even a 'ping'. By my understanding of Layer 2, this should work right now, whether the ISP service is working or not - WHAT AM I DOING WRONG?
The addressing scheme I have ended up on is 172.16.1.0/28
Obviously without the first hurdle cleared, of why the switched LAN doesn’t work, I haven't got any deeper. Do I need to configure NAT? I don't think I would need to in the scenario right?
All of my experience, and none at the CCNA level, has been with larger Cisco equipment. One thing I noticed on the 1811 was that when trying to create a new VLAN, it appears to work yet does not do anything and the 'sh vlans' output returns nothing, not even the VLAN1 I can see with 'sh ip int brief".
Anyway, if anyone has time to help a newbie out I would appreciate it; I’m lost.
Thanks,
JoshThanks for the help Andrew! You know, I think if this was two separate devices (switch and router) I think I would be up and running, but this integrated stuff is throwing me off, not to mention that the IOS is a much older version (I guess) than what I'm used to.
They were throwing this 1811 in the trash can at work, so I just emptied the trash can. I have no documentation at all but I have since found the 1800 series documentation on Cisco.com and have tried to implement the basic configurations cited; with what seems like success, but still no joy. I did have to recover the password and did so with 0x2142, I bypassed the setup and compared the default configuration with what is listed in the documentation and they DO NOT match; I also tried to go through setup mode with the same indications. Additionally I've also learned that the 1800 series is pre-configured on certain options (DHCP, VLAN), which is new to me - I thought Cisco routers were not configured by default - isn't that kind of the point? (By the way, the below port status may not be correct since I now have all the ports unplugged)
Anyway, here is the 'show run' command, the 'sh ip int brief' command, followed by the 'sh version' command:
Show Run
Casino#sh run
Building configuration...
Current configuration : 2006 bytes
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption
hostname Casino
boot-start-marker
boot-end-marker
enable secret 5 $1$meWw$nsMTp6US7axi/uE0MWULK.
enable password 7 06535E741C1B584C55
no aaa new-model
ip cef
no ip dhcp use vrf connected
ip dhcp excluded-address 172.16.1.1
ip dhcp pool Casino
import all
network 172.16.1.0 255.255.255.240
default-router 67.165.208.1
dns-server 68.87.89.150
domain-name hsd1.co.comcast.net
no ip domain lookup
ip domain name GinRummy.localhost
ip name-server 68.87.85.102
ip name-server 68.87.69.150
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
multilink bundle-name authenticated
archive
log config
hidekeys
interface Loopback0
ip address 172.16.1.1 255.255.255.240
interface FastEthernet0
no ip address
shutdown
duplex auto
speed auto
interface FastEthernet1
ip address dhcp
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1
interface BRI0
no ip address
encapsulation hdlc
shutdown
interface FastEthernet2
interface FastEthernet3
interface FastEthernet4
interface FastEthernet5
interface FastEthernet6
interface FastEthernet7
interface FastEthernet8
interface FastEthernet9
interface Vlan1
no ip address
ip nat inside
ip virtual-reassembly
interface Dialer0
ip address negotiated
ip mtu 1492
encapsulation ppp
dialer pool 1
ppp authentication chap
ip forward-protocol nd
no ip http server
no ip http secure-server
ip nat pool Casino 172.16.1.2 172.16.1.14 netmask 255.255.255.240
ip nat inside source list 1 interface Dialer0 overload
access-list 1 permit 172.16.1.0 0.0.0.15
dialer-list 1 protocol ip permit
control-plane
line con 0
password 7 080E5916584B4442435E5C
login
line aux 0
password 7 013C135C0A59475A70191E
login
line vty 0 4
password 7 09635B51485756475A5954
login
end
Show IP Interface Brief
Casino#sh ip int brief
Interface IP-Address OK? Method Status Prl
FastEthernet0 unassigned YES NVRAM administratively down do
FastEthernet1 unassigned YES DHCP up do
BRI0 unassigned YES NVRAM administratively down do
BRI0:1 unassigned YES unset administratively down do
BRI0:2 unassigned YES unset administratively down do
FastEthernet2 unassigned YES unset up do
FastEthernet3 unassigned YES unset up do
FastEthernet4 unassigned YES unset up do
FastEthernet5 unassigned YES unset up do
FastEthernet6 unassigned YES unset up do
FastEthernet7 unassigned YES unset up do
FastEthernet8 unassigned YES unset up do
FastEthernet9 unassigned YES unset up up
Vlan1 unassigned YES NVRAM up up
Loopback0 172.16.1.1 YES manual up up
Dialer0 unassigned YES manual up up
NVI0
'show version'
Casino#sh ver
Cisco IOS Software, C181X Software (C181X-ADVIPSERVICESK9-M), Version 12.4(15))
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2008 by Cisco Systems, Inc.
Compiled Thu 24-Jan-08 13:05 by prod_rel_team
ROM: System Bootstrap, Version 12.3(8r)YH12, RELEASE SOFTWARE (fc1)
Casino uptime is 52 minutes
System returned to ROM by reload at 17:09:25 UTC Fri Jul 1 2011
System image file is "flash:c181x-advipservicesk9-mz.124-15.T3.bin"
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
[email protected].
Cisco 1812 (MPC8500) processor (revision 0x400) with 118784K/12288K bytes of m.
Processor board ID FHK120622J3, with hardware revision 0000
10 FastEthernet interfaces
1 ISDN Basic Rate interface
31488K bytes of ATA CompactFlash (Read/Write)
Configuration register is 0x2102
Thanks again for your help,
Josh -
Hello
I am very new to Java and am currently studying a course in the language.
I am working through a tutorial at the moment and a question has been asked and I am struggling a bit
I have been given the code to a program that creates a window with a ball bouncing around inside the window.
There are 2 classes (code below) - Call class - this contains all the code need to create the ball and BallWorld Class (the main Class) this create the window and moves the ball, it also detects if the ball hits the edge of the window, whne this happens it redirects the ball. I understand how all this code works
I have been asked the following:-
Rather than testing whether or not the ball has hit the wall in the nmain program, we could use inhertitance to provide a specialized forom of Ball. Create a class BoundedBall that inherits from the class Ball. The constructor for this class should provide the height and width of the window, which should be maintained as data fields in the class, rewrite the move method so that the ball moves outside the bound, it automatically reflects its direction. Finally rewrite the BallWorld class to use an instance of BoundedBall rather than ordianary Ball, and elimiante the bounds test in the main program.
I am having trouble with this and I can not get my code to work, I think I may be going in completly the wrong direction with the code can sombody please provide me with a simple working code for both the BoundedBall and ammended BallWorld class, as this will help me understand whare I am going wrong
Ball class
//a generic round colored object that moves
import java.awt.*;
public class Ball {
public Ball (Point lc, int r) { //constructor for new ball
//ball centre at point loc, radius rad
loc = lc;
rad = r;
protected Point loc; //position in window
protected int rad; //radius of ball
protected double changeInX = 0.0; //horizontal change in ball position in one cycle
protected double changeInY = 0.0; //vertical change in ball position in one cycle
protected Color color = Color.blue; //colour of ball
//methods that set attributes of ball
public void setColor(Color newColor) {color = newColor;}
public void setMotion(double dx,double dy)
{changeInX = dx; changeInY = dy;}
//methods that access attributes of ball
public int radius() {return rad;}
public Point location() {return loc;}
//methods to reverse motion of the ball
public void reflectVert(){ changeInY = -changeInY; }
public void reflectHorz(){ changeInX = -changeInX; }
//methods to move the ball
public void moveTo(int x, int y) {loc.move(x,y);}
public void move(){loc.translate((int)changeInX, (int)changeInY);}
//method to display ball
public void paint (Graphics g) {
g.setColor(color);
g.fillOval(loc.x-rad, loc.y-rad, 2*rad, 2*rad);
BallWorld class
//A bouncing ball animation
import java.awt.*; //import the awt package
import javax.swing.JFrame; //import the JFrame class from the swing package
public class BallWorld extends JFrame{
public static void main (String [] args){
BallWorld world = new BallWorld(Color.red);
world.show();
for(int i = 0; i < 1000; i++) world.run();
System.exit(0);
public static final int FrameWidth = 600;
public static final int FrameHeight = 400;
private Ball aBall = new Ball(new Point (50,50),20);
private BallWorld(Color ballColor) { //constructor for new window
//resize frame, initialize title
setSize(FrameWidth, FrameHeight);
setTitle("Ball World");
//set colour and motion of ball
aBall.setColor(ballColor);
aBall.setMotion(3.0, 6.0);
public void paint (Graphics g) {
//first draw the ball
super.paint(g);
aBall.paint(g);
public void run(){
//move ball slightly
aBall.move();
Point pos =aBall.location();
if ((pos.x < aBall.radius()) ||
(pos.x > FrameWidth - aBall.radius()))
aBall.reflectHorz();
if ((pos.y < aBall.radius()) ||
(pos.y > FrameHeight - aBall.radius()))
aBall.reflectVert();
repaint();
try{
Thread.sleep(50);
} catch(InterruptedException e) {System.exit(0);}Here - you can study this :0))import java.awt.*;
import javax.swing.*;
public class MovingBall extends JFrame {
mapPanel map = new mapPanel();
public MovingBall() {
setBounds(10,10,400,300);
setContentPane(map);
public class mapPanel extends JPanel {
Ball ball = new Ball(this);
public void paintComponent(Graphics g) {
super.paintComponent(g);
ball.paint(g);
public class Ball extends Thread {
mapPanel map;
int x = 200, y = 20, xi = 1, yi = 1;
public Ball(mapPanel m) {
map = m;
start();
public synchronized void run(){
while (true) {
try{
sleep(10);
catch(InterruptedException i){
System.out.print("Interrupted: ");
move();
public void move() {
map.repaint(x-1,y-1,22,22);
if (x > map.getWidth()-20 || x < 0) xi = xi*-1;
if (y > map.getHeight()-20 || y < 0) yi = yi*-1;
x = x + xi;
y = y + yi;
map.repaint(x-1,y-1,22,22);
public void paint(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
g2.setColor(Color.red);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.fillOval(x,y,20,20);
g2.dispose();
public static void main(String[] args) {
new MovingBall().show();
} -
Can someone help with this simple application
I am taking my first java class and there are limited resourses for the class as far as getting help with coding.
Any hoo if any one can point me in the correct direction from the following information listed below I would be greatfull. I am trying to use the set and get methods on the instance veriables and then I am goign to post the results once I get them workign to a JOption pane window.
examples are most welcome thanks
// Invoice.java
// Homework assignment 3.13
// Student Arthur Clark
public class Invoice // public class
String partNumber;// instance veriable quantity
String partDescription;// instance verialbe partDescription
//constructors
public void setpartNumber( String number, String description )
partNumber = number; //initalize quantity
partDescription = description; // initalize partDescription
}// end constructors
//method getpartNumber
public String getpartNumber()
return partNumber;
}//end method getpartNumber
public String getpartDescription()
return partDescription;
}// end method getpartDescription
public void displayMessage()
//this is the statement that calls getpartNumber
System.out.printf(" part number # \n%s!\n the description", getpartNumber(), getpartDescription() );
} // method displaMessage
}// end method main
// Fig. 3.14 InvoiceTest.java
// Careate and manipulate an account object
import java.util.Scanner;
import javax.swing.JOptionPane;//import JOptionPane
public class InvoiceTest{
// main method begins the exciution of the program
public static void main ( String args [] )
// create Scanner to obtain input from mommand window
Scanner input = new Scanner ( System.in );
// create a Invoice object and assig it to mymethod
Invoice myMethod = new Invoice();
Invoice myMethod2 = new Invoice();
// display inital value of partName, partDescriptoin
System.out.printf( "inital partname is %s\n\n", myMethod.getpartNumber() );
// prompt for and read part name, partDescription
System.out.println( "please enter the Part Number:" );
String theNumber = input.nextLine(); // read a line of text
myMethod.setpartNumber( theNumber ); // set the part name with in the parens
System.out.println();// outputs blank line
myMethod.displayMessage();
System.out.println( "please enter the Part Description" );
String theDescription = input.nextLine(); // read a line of text
myMethod2.setpartDescription( theDescription );// set the part description
System.out.println();// outputs blank line
myMethod2.displayMessage();
}// end main mehtod
}// end class//constructors
public void setpartNumber( String number, String description )
partNumber = number; //initalize quantity
partDescription = description; // initalize partDescription
}// end constructorsThe above code is not a constructor. You do not include a return type, void or anything else. Also, the constructor should be called the same as your class.
public Invoice( String number, String description )
partNumber = number;
partDescription = description;
} Another thing, comments should only be used when it isn't bleedingly obvious what your code is doing.
P.S. is your middle initial C? -
Can anyone help with a mac book pro gray screen
can anyone help with a macbook pro gray screen
Hi Tom,
Read through the following link and try a Safe Boot: http://support.apple.com/kb/TS2570 -
Idiot needs help with hanging mac book pro please
can anyone please help me
i have a 13 inch 2013 macbook pro but since yesterday every 30/40 seconds if im trying the spinner circle thing comes up and even now I'm trping faster than my mac can keep up
iv installed nothing recently
im really stuck where to go from here
really sorry if I'm vague but I'm not a computer genius
if all fails then i have to take it back to apple
thanks for any helpEtreCheck version: 2.1.5 (108)
Report generated 3 January 2015 17:53:58 GMT
Click the [Support] links for help with non-Apple products.
Click the [Details] links for more information about that line.
Click the [Adware] links for help removing adware.
Hardware Information: ℹ️
MacBook Pro (13-inch, Mid 2012) (Verified)
MacBook Pro - model: MacBookPro9,2
1 2.9 GHz Intel Core i7 CPU: 2-core
8 GB RAM Upgradeable
BANK 0/DIMM0
4 GB DDR3 1600 MHz ok
BANK 1/DIMM0
4 GB DDR3 1600 MHz ok
Bluetooth: Good - Handoff/Airdrop2 supported
Wireless: en1: 802.11 a/b/g/n
Video Information: ℹ️
Intel HD Graphics 4000
Color LCD 1280 x 800
System Software: ℹ️
OS X 10.10.1 (14B25) - Uptime: 2:36:51
Disk Information: ℹ️
TOSHIBA MK7559GSXF disk0 : (750.16 GB)
EFI (disk0s1) <not mounted> : 210 MB
Recovery HD (disk0s3) <not mounted> [Recovery]: 650 MB
Macintosh HD (disk1) / : 748.93 GB (635.73 GB free)
Encrypted AES-XTS Unlocked
Core Storage: disk0s2 749.30 GB Online
MATSHITADVD-R UJ-8A8 disk2 : (329.8 MB)
disk2s1 (disk2s1) <not mounted> : 287 MB
disk2s1s1 (disk2s1s1) <not mounted> : 32 KB
Untitled Disc (disk2s1s2) /Volumes/Untitled Disc : 286 MB (0 B free)
USB Information: ℹ️
Western Digital External HDD 160.04 GB
WD USB 2 (disk3s1) /Volumes/WD USB 2 : 160.04 GB (64.46 GB free)
Apple Inc. FaceTime HD Camera (Built-in)
Apple Inc. Apple Internal Keyboard / Trackpad
Apple Computer, Inc. IR Receiver
Apple Inc. BRCM20702 Hub
Apple Inc. Bluetooth USB Host Controller
Thunderbolt Information: ℹ️
Apple Inc. thunderbolt_bus
Gatekeeper: ℹ️
Mac App Store and identified developers
Launch Agents: ℹ️
[loaded] com.divx.dms.agent.plist [Support]
[loaded] com.divx.update.agent.plist [Support]
[invalid?] com.oracle.java.Java-Updater.plist [Support]
Launch Daemons: ℹ️
[loaded] com.adobe.fpsaud.plist [Support]
[loaded] com.microsoft.office.licensing.helper.plist [Support]
[invalid?] com.oracle.java.Helper-Tool.plist [Support]
[loaded] com.tunabellysoftware.TGFanHelper.plist [Support]
User Launch Agents: ℹ️
[loaded] com.adobe.ARM.[...].plist [Support]
[loaded] com.divx.agent.postinstall.plist [Support]
[loaded] com.google.keystone.agent.plist [Support]
User Login Items: ℹ️
iTunesHelper Application (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
Google Drive Application (/Applications/Google Drive.app)
Safari Application (/Applications/Safari.app)
Internet Plug-ins: ℹ️
Flip4Mac WMV Plugin: Version: 3.0.0.126 - SDK 10.8 [Support]
FlashPlayer-10.6: Version: 16.0.0.235 - SDK 10.6 [Support]
Default Browser: Version: 600 - SDK 10.10
AdobePDFViewerNPAPI: Version: 11.0.10 - SDK 10.6 [Support]
AdobePDFViewer: Version: 11.0.10 - SDK 10.6 [Support]
DivXBrowserPlugin: Version: 2.2 [Support]
Flash Player: Version: 16.0.0.235 - SDK 10.6 [Support]
OVSHelper: Version: 1.1 [Support]
QuickTime Plugin: Version: 7.7.3
SharePointBrowserPlugin: Version: 14.1.0 [Support]
JavaAppletPlugin: Version: 15.0.0 - SDK 10.10 Check version
Safari Extensions: ℹ️
DivX Plus Web Player HTML5 <video> [Installed]
3rd Party Preference Panes: ℹ️
Flash Player [Support]
Flip4Mac WMV [Support]
Perian [Support]
Time Machine: ℹ️
Time Machine not configured!
Top Processes by CPU: ℹ️
19% Finder
2% WindowServer
0% AppleSpell
0% DesktopServicesHelper
0% mds_stores
Top Processes by Memory: ℹ️
429 MB iPhoto
198 MB Finder
180 MB iTunes
144 MB com.apple.WebKit.WebContent
112 MB mds_stores
Virtual Memory Information: ℹ️
1.97 GB Free RAM
4.26 GB Active RAM
1.32 GB Inactive RAM
1.03 GB Wired RAM
3.49 GB Page-ins
0 B Page-outs
Diagnostics Information: ℹ️
Jan 3, 2015, 03:18:42 PM Self test - passed
Jan 1, 2015, 02:04:03 PM /Library/Logs/DiagnosticReports/com.apple.WebKit.WebContent_2015-01-01-140403_[ redacted].cpu_resource.diag [Details] -
Im DROWNING! need help with a simple java assignment! plz someone help me!
i need help with my java assignment, with validating a sin number. easy for must who know java. im drowning... please help!
You will need to store each digit of the social insurance number in a field of its own. To validate the entry you will:
1. Multiply the 2nd, 4th, 6th and 8th digit by 2.
2. If the product of any of the four multiplications result in a value greater than 9, add the two resulting digits together to yield a single-digit response. For example 6 * 2 = 12, so you would add the 1 and the 2 to get a result of 3.
3. Add these four calculated values together, along with the 1st, 3rd, 5th, and 7th digits of the original number.
4. Subtract this sum from the next highest multiple of 10.
5. The difference should be equal to the 9th digit, which is considered the check digit.
Example of validating S.I.N. 765932546
1st digit 7
2nd digit (6*2 =12 1+2=) 3
3rd digit 5
4th digit (9*2 = 18 1+8 =) 9
5th digit 3
6th digit (2*2 = 4) 4
7th digit 5
8th digit (4*2 = 8) 8
Total 44 next multiple of 10 is 50
50-44 = 6 which is the 9th digit
Therefore the S.I.N. 765932546 is Valid
********* SIN Validation *********
Welcome - Please enter the first number: 120406780
Second digit value multiplied by 2 4
Fourth digit value multiplied by 2 8
Sixth digit value multiplied by 2 12
Eighth digit value multiplied by 2 16
Value derived from 6th digit 3
Value derived from 8th digit 7
The total is 30
Calculated digit is 10
Check digit must be zero because calculated value is 10
The SIN 120406780 is Valid
this is my assignemtn this is what i have! i dont know where to start! please help me!
/* File: sinnumber.java
Author: Ashley
Date: October 2006
Purpose: Lab1
import java.util.Scanner;
public class Lab1
public static void main(String[] args)
Scanner input = new Scanner(System.in);
int sin = 0;
int number0, number1, number2, number3, number4, number5, number6, number7, number8;
int count = 0;
int second, fourth, sixth, eighth;
System.out.print("\t\n**********************************");
System.out.print("\t\n**********SIN Validation**********");
System.out.print("\t\n**********************************");
System.out.println("\t\nPlease enter the First sin number: ");
sin = input.nextInt();
count = int.length(sin);
if (count > 8 || count < 8)
System.out.print("Valid: ");
} -
I need help with some simple code! Please read!
hi everyone.
I'm having problems with a piece of code, and i'd be extremely greatful if somebody could give me a hand with it. I'm totally new to java and have to make a program for my university degree, but i'm finding it extremely difficult, mainly due to my total lack of apptitude for this type of thing. I know this is easy stuff, but the books I have are no use so any help would be greatly appreciated.
I have to write a program which uses two class files. I want one with the code to produce a simple button, and one to invoke it several times at different locations. I decided to write the program as one class file at first, and thought i'd be able to split it up at later. The program works fine when it is one class file. My book said that to split the two classes up, all i needed to do was change the second class to public, although this seems to not work at all. I'm at my wits end on this, and if anyone could correct my code I'd be eternally greatful.
Here is the first class... (sorry about the lack of indentation)
>>>>>>>>>>
import java.awt.*;
import java.applet.Applet;
public class Phone extends Applet {
private Image image;
public void init() {
setLayout(null);
image = getImage(getDocumentBase(), "phone.jpg");}
public void paint (Graphics g) {
g.drawImage(image, 0, 0, 700, 530, this);
PhoneButton myButton;
myButton = new PhoneButton(20,20);
>>>>>>>
This is the second class....
>>>>>>>
public class PhoneButton {
private Button butt;
public PhoneButton(int a, int b, int c){
setLayout(null);
butt = new Button();
butt.setBounds(a,b,20,20);
add(butt);
>>>>>>>>
My compiler generates errors relating to Button, but i can't do anything to please it.
Also, could anyone give me some pointers on how to add a different number or symbol to each button. That is what I added int c for, but i couldn't get it to work.
Cheers in advance.
Michael MorganI found that there are 5 error in your code.
1. You should import the "java.awt" package to the PhoneButton.java
2. The PhoneButton is not a kind of Component. You cannot not add it to the Phone class
3. the myButton = new PhoneButton(20, 20) does not provide enough parameters to create PhoneButton
4. You cannot add a Button to a PhoneButton. Becaue the PhoneButton is not a kind of Container
Fixed code:
import java.awt.*;
public class PhoneButton extends Button {
public PhoneButton(int a, int b, int c){
setBounds(a, b, 20, 20);
setLabel(String.valueOf(c));
===========================================
import java.awt.*;
import java.applet.Applet;
public class Phone extends Applet {
private Image image;
public void init() {
setLayout(null);
image = getImage(getDocumentBase(), "phone.jpg");}
public void paint (Graphics g) {
g.drawImage(image, 0, 0, 700, 530, this);
PhoneButton myButton;
myButton = new PhoneButton(20,20, 1);
======================
Visual Paradigm for UML - Full Features UML CASE tool
http://www.visual-paradigm.com/ -
Help with a program book ad page
Hello,
I have finished creating an ad for a program book and I cannot get it to either print right or when I did get it to do right I now have a right margin going into the crease and I have my ad going over the 1/4 margins on the bottom.
First I set up a 8.5 in by 5.5 in page size (size of program book) because I am only going to be using 1/2 of that page for my ad. I finished my design, then printed it out. My design came out landscape on the page, rather than upright portrait on the page. Obviously I think Im getting its because of the way it wants to print it. There are not many choices given in the print options for telling it to print a certain way (at least I cant find it).
Now, after messing with that a few times, I somehow finally got it to print at the top left of my paper (it actually doesnt matter if its at the top or bottom). When I fold it to 8.5 in x 5.5 in and fold the book in half I can see its not set up correct. I am not sure if its on my end or if its the printer again. The right margin runs into the spine of my paper (or crease) and the bottom of my ad has run over the middle crease. My left margin is at least 1/2" away from the left edge of my paper. I need my ad to be 1/2 the page of a 8.5in x 5.5 in page. The ad's are sold as a full page or 1/2 page.
My page set up is as a document. Its set as Page Size: Letter - 1/2 (I did not set this?), width 5.5 in and height 8.5 in, orientation is Portrait. I do have a bleed, but I dont need it and ignore it. Ive started my ad at the top Margin lines, but I made ad short of the right margin, so as to leave room near the inside crease where it would be stapled. I did not set up these margin lines and not sure how to change it. When I added my background artwork, I pulled it down till it turned PINK so that I would know where the middle of the page is. But my ad prints over this.
I am needing this ad to be at least 1/2" away from the top, left and right margin of the page and pretty close to the 1/2 page mark, but not over. Do i make sense?
Now, just a little back ground. Ive designed program books in the past using Publisher. I designed a whole program book, cover to cover and I had very little issues doing it. Now I am using InDesign for the first time to do this and struggling a bit here. The printing of stuff from ID is also driving me nuts. Im not liking the way ID prints and if I tell my Epson printer how to print, it doesnt work and continues to give me crappy outputs.
Any help would be appreciated. I need to turn this in tonight, but i cant turn in a camera ready printout if its not printing out correctly.
Thank you,
TinaNeverWasBefore wrote:
So, whatever is the easiest way for her to get this ad, so that she doesnt somehow mess it up.
You really can't control for that. If she doesn't know what she's doing, you could send her a technician with a brand new printer, and she could do it wrong. The best you can do is to communicate to her what you intend, and hope she can pull it off. I'd send a PDF set to the final size with the margins, and one without the margins. When she opens them, she will see something like this:
This is a screenshot from Acrobat showing the white document size against the black background that represents what is outside of the document. You can see the amount of white space that surrounds the image area (the placeholder type), so you know how much border you intended.
Now, your InDesign document is half-letter size (5.5x8.5). If you subtract the amount of margin you used (in my example, I used .5" on all sides), you have the size of the image area (my example has a 4.5x7.5 image area). You can make a new InDesign document the size of your image area (4.5x7.5) and place the PDF that has the margins (like in the screenshot above) onto the page and position it so that the image area lines up with the document page borders, as you can see in this screenshot:
You can see the blue InDesign image frame with the handles, which is the size of the half-letter PDF, and the image area contained within the document border, which is the black stroke that you normally see in InDesign. Don't worry about the magenta inner margin—that could be set to anything, and isn't in play here. In order to position the placed PDF into the new 4.5x7.5 InDesign document, when you place the PDF, check the Show Import Options box in the Place window. that will bring up a new screen after you select which image you are placing and you hit the OK button. The screen looks like this:
In the Options section, change the Crop to from Bounding Box (Visible Layers only) (which should be the default choice) to Art, and you will see the dotted line that represents the size of the image change to include the margins.
Now, when you place the image, just set the position proxy (which looks like this: ) to the top left corner and in the X and Y fields, enter the negative of the amount of margin you have. Since I used .5" margins, I set X and Y to -.5" each, and that aligned the image area of the larger PDF to the document borders of the smaller InDesign document. You could just eyeball it in if you want, but this way you can be a little more sure you aren't cutting off a hair of some of your image area.
If you export that document to PDF, it will look like this:
…which the person who will be putting this together will probably use, since it will be easier to place into something like Publisher or Word because it is smaller than a half page (an image that is larger than the document will probably be reduced in size to fit automatically—something that Word does, and maybe Publisher does that too, but I don't use Publisher so I don't know). How She positions it within the page is up to her, and not something you can control unless you are in the room with her, so it's a crapshoot. She could also use the PDF with the margins if it works better for her, but all you can do is explain to her what you are sending and what you would like. -
Can anyone help with a simple coding problem?
I'm creating a website using Dreamweaver MX 2004 and making a
real mess of it!
I have created two pages which are identical in terms of
background, but one has a text box in the middle. What I want to
happen when you click the link to this page is the first one
without the text box appears for a couple of seconds, then the
other page automatically loads to give the impression that this
text box has magically appeared. really simple, but I can't find
any behaviour codes to make this happen!
Can anyone help me out with a code or give me a clue to how
it can be achieved really easily.
Cheers everyone!You can try just using the same page and hiding and showing
the layer using the Behaviors menu. that would acheive the same
thing without having to load another page.
Maybe you are looking for
-
Greyed Out "Free Space" in Disk Utility
Hi I have a problem with my main Logical Volume Group / Partition. So My main Logical Volume Group (Macintosh HD) was separated into 2 partitions. I decided to delete the second one, and once the process started in Disk Utility, it crashed. Now if I
-
Is it possible to load balance incoming requests based on client's operating system on ACE? For example, we have different web pages specifically for Blackberry or iPhones. Instead of having multiple URL's & VIP's, we'd like to have a single VIP, but
-
E-recruitment 600 browser supported?
Hi Experts, E-recruitment 600 version can only support IE 9 and latest firefox. Is this something to do with the SAP Netweaver? If we upgrade to SAP Netweaver 7.31, will E-recruitment 600 able to support other types of browser? Regards, TCL
-
Surface 2 Keyboard is not detected after waking up for sleep
I'm running Windows 8.1 on the Surface 2(RT). I forget the keyboard name, but it is the purple one with the back lit keys. When I wake the surface upon from sleep it is very rarely that the keyboard will work. Most times I need to detach it a few ti
-
Cannot create partition on macbookpro 13" retina late 2013
I tryed several times but always the same error, I cannot create partition on macbookpro 13" retina late 2013, maverick and win 7 64 I read this article but doesn't resolve: http://support.apple.com/kb/TS4560?viewlocale=en_US&locale=en_US Please help